]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
omit mysql8 dupe key alias for INSERT..FROM SELECT
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Aug 2024 13:13:51 +0000 (09:13 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Aug 2024 13:14:31 +0000 (09:14 -0400)
commit36198e16fb36cba572af36d0aa09a5149fcf7812
tree67656240eb75ca637726532dba0ea95c395e4d4e
parent1f58ce14568ec59dc7f8125caa736c2acbf40e89
omit mysql8 dupe key alias for INSERT..FROM SELECT

Fixed issue in MySQL dialect where using INSERT..FROM SELECT in combination
with ON DUPLICATE KEY UPDATE would erroneously render on MySQL 8 and above
the "AS new" clause, leading to syntax failures.  This clause is required
on MySQL 8 to follow the VALUES clause if use of the "new" alias is
present, however is not permitted to follow a FROM SELECT clause.

Fixes: #11731
Change-Id: I254a3db4e9dccd9a76b11fdfe6e38a064ba0b5cf
(cherry picked from commit 63b45202848de0cb3cfd41de130000355cbb88ef)
doc/build/changelog/unreleased_20/11731.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_on_duplicate.py