[Sqlalchemy-tickets] Issue #3541: Undesired SQL generated on update (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Gorka E. <iss...@bi...> - 2015-09-24 13:32:11
|
New issue 3541: Undesired SQL generated on update https://bitbucket.org/zzzeek/sqlalchemy/issues/3541/undesired-sql-generated-on-update Gorka Eguileor: In some SQL DBs the UPDATE operation is order dependent, so the operation behaves differently depending on the order of the values. As an example, a volumes table with columns 'status' and 'previous_status' and we want to update a volume that has 'available' in the status column. If the SQL query is generated as: UPDATE volumes SET previous_status=status, status='new' WHERE id=1; This will result in a volume with 'new' status and 'available' previous_status both on SQLite and MariaDB, but if columns get reversed and the query is generated as: UPDATE volumes SET status='new', previous_status=status WHERE id=1; We will get the same result in SQLite but will result in a volume with status and previous_status set to 'new' in MariaDB, which is not what we want. And this cannot be selected when calling update or values on update(). |