-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Regular expression in executemany doesn't support new alias syntax for INSERT ... ON DUPLICATE KEY UPDATE #898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I suggest to add a non-capturing group
I can make a PR if you agree. |
I do not anything except bugfix in this year. Please wait a half year. |
Are you agree with suggested solution? Are you ready to accept pull requests now? |
Nice |
|
6750
FYI, I hit this issue migrating from SqlAlchemy 1.4 to 2.0 where PyMySQL was used as the driver, this is because SqlAlchemy 2.0 detects the version of MySQL DB and uses the newer syntax if the database version is high enough. The performance slowdown for my statements were between 10x and 100x. Based on responses from SqlAlchemy maintainers I switched to mysqlclient as the driver, which from initial testing doesn't have this issue. |
Regular expression in executemany
doesn't support new introduced in MySQL 8.0.19 alias syntax like
INSERT INTO t1 (a,b,c) VALUES (%s,%s,%s) AS new ON DUPLICATE KEY UPDATE c = new.a+new.b;
while old supported values function syntax is deprecated since 8.0.20 (https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html)
INSERT INTO t1 (a,b,c) VALUES (%s,%s,%s) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);
The text was updated successfully, but these errors were encountered: