]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
use mysql 8 syntax for ON DUPLICATE KEY UPDATE
authorCaspar Wylie <casparwylie@Caspars-MacBook-Pro.local>
Fri, 3 Feb 2023 14:23:26 +0000 (09:23 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 6 Feb 2023 16:00:57 +0000 (11:00 -0500)
commit2a9487fefcc915ae411a8edc48d5203619ed642b
tree451202ef4835e95c215e8f19c31016a70f400358
parent0635235090c85e2c1a18676ca49652d2c2094925
use mysql 8 syntax for ON DUPLICATE KEY UPDATE

Added support for MySQL 8's new ``AS <name> ON DUPLICATE KEY`` syntax when
using :meth:`_mysql.Insert.on_duplicate_key_update`, which is required for
newer versions of MySQL 8 as the previous syntax using ``VALUES()`` now
emits a deprecation warning with those versions. Server version detection
is employed to determine if traditional MariaDB / MySQL < 8 ``VALUES()``
syntax should be used, vs. the newer MySQL 8 required syntax. Pull request
courtesy Caspar Wylie.

Fixes: #8626
Closes: #9210
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9210
Pull-request-sha: 1c8dfbf0b4c439d9ca2c194524c47eb7239ee3c5

Change-Id: I42c463837af06bc15b60c534159804193df07f02
doc/build/changelog/unreleased_20/8626.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/mysql/test_compiler.py