Skip to content

Add ability to preserve order in MySQL ON DUPLICATE KEY UPDATE.#462

Closed
satori wants to merge 1 commit into
zzzeek:masterfrom
satori:mysql_on_dup_key_preserve_order
Closed

Add ability to preserve order in MySQL ON DUPLICATE KEY UPDATE.#462
satori wants to merge 1 commit into
zzzeek:masterfrom
satori:mysql_on_dup_key_preserve_order

Conversation

@satori
Copy link
Copy Markdown

@satori satori commented Jul 9, 2018

In MySQL UPDATE behavior differs from standard SQL in the way
that assignments are generally evaluated from left to right and
old values being referenced in UPDATE are getting replaced one by one
to their new values.
This makes it important to have ability preserve exact order of columns
in UPDATE clause.

Change-Id: If508d8e26dbd3c55ab1e83cf573fb4021e9d091e

In MySQL UPDATE behavior differs from standard SQL in the way
that assignments are generally evaluated from left to right and
old values being referenced in UPDATE are getting replaced one by one
to their new values.
This makes it important to have ability preserve exact order of columns
in UPDATE clause.

Change-Id: If508d8e26dbd3c55ab1e83cf573fb4021e9d091e
@zzzeek
Copy link
Copy Markdown
Owner

zzzeek commented Jul 10, 2018

this looks like a really great pull request - thanks! I need to find time to review carefully.

@zzzeek
Copy link
Copy Markdown
Owner

zzzeek commented Jul 18, 2018

going to pull this into gerrit.

@zzzeek
Copy link
Copy Markdown
Owner

zzzeek commented Jul 18, 2018

the review is at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/829 (my script to close this automatically didn't work)

@zzzeek zzzeek closed this Jul 18, 2018
zzzeek pushed a commit that referenced this pull request Aug 15, 2018
Added support for the parameters in an ON DUPLICATE KEY UPDATE statement on
MySQL to be ordered, since parameter order in a MySQL UPDATE clause is
significant, in a similar manner as that described at
:ref:`updates_order_parameters`.  Pull request courtesy Maxim Bublis.

Pull-request: #462
Change-Id: If508d8e26dbd3c55ab1e83cf573fb4021e9d091e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants