no support for ORDER BY in db.update

Bug #598080 reported by Shinjo Park
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
web.py
New
Undecided
Unassigned

Bug Description

Although UPDATE ... SET ... ORDER BY .... is valid SQL, current db module doesn't support this. Current documentation shows arguments for db.select works for db.update, and there's no mention about order is not working in update.

Supposed to be work:
ret = self.db.update('Articles', vars = val, where = 'bSerial = $board_id AND aIndex >= $index',
                order = 'aIndex DESC', aIndex = web.SQLLiteral('aIndex + 1'))

Result:
ERR: UPDATE Articles SET order = 'aIndex DESC', aIndex = aIndex + 1 WHERE bSerial = 1371L AND aIndex >= 48L

Finally:
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order = 'aIndex DESC', aIndex = aIndex + 1 WHERE bSerial = 1371 AND aIndex >= 48' at line 1")

Revision history for this message
Anand Chitipothu (anandology) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.