]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
hardcode now(), current_timstamp() into the MySQL regex
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Jun 2025 12:58:49 +0000 (08:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Jun 2025 16:41:57 +0000 (12:41 -0400)
commitfb319825dc0a0b4ef1c3aead13c179b0f97ca6a2
treea710448ee36ee6cff5d4648dd3e3f39910071075
parent5ebc3e095b4d3c16b28337fe87cab6ed5d766551
hardcode now(), current_timstamp() into the MySQL regex

Fixed yet another regression caused by by the DEFAULT rendering changes in
2.0.40 :ticket:`12425`, similar to :ticket:`12488`, this time where using a
CURRENT_TIMESTAMP function with a fractional seconds portion inside a
textual default value would also fail to be recognized as a
non-parenthesized server default.

There's no way to do this other than start hardcoding a list
of MySQL functions that demand that parenthesis are not added around
them, I can think of no other heuristic that will work here.
Suggestions welcome

Fixes: #12648
Change-Id: I75d274b56306089929b369ecfb23604e9d6fa9dd
(cherry picked from commit 8e9f789f1aa0309005e8b7725643b32802e7d214)
doc/build/changelog/unreleased_20/12648.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_query.py