]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
fix: Update reserved words list of MySQL / MariaDB dialect
authorKevin Kirsche <kevin.kirsche@one.verizon.com>
Tue, 19 Oct 2021 21:22:03 +0000 (17:22 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 20 Oct 2021 16:57:48 +0000 (12:57 -0400)
commitba278a16f3e0c54bb9db8dfb37b3f9b776b7f2e5
tree627f2c0de57511ac1888bb314ac503f670282ef0
parent4bad8b5a7f48d571bd1e96908299134830ff462f
fix: Update reserved words list of MySQL / MariaDB dialect

Reorganized the list of reserved words into two separate lists, one for
MySQL and one for MariaDB, so that these diverging sets of words can be
managed more accurately; adjusted the MySQL/MariaDB dialect to switch among
these lists based on either explicitly configured or
server-version-detected "MySQL" or "MariaDB" backend. Added all current
reserved words through MySQL 8 and current MariaDB versions including
recently added keywords like "lead" . Pull request courtesy Kevin Kirsche.

1. Move reserved words to it's own file.
2. Add missing reserved words from https://mariadb.com/kb/en/reserved-words/
    * Note: this only adds MariaDB though links to MySQL, it also does not
      include the reserved words for Oracle mode, as listed in the link.

Fixes: #7167
Supercedes: #7197
Closes: #7207
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7207
Pull-request-sha: 5a682e331069520ccad9e6bf3cc5e4a77a889ef0

Change-Id: Ib25be8148568899f56b5c9b42d4f530ade8a04e3
doc/build/changelog/unreleased_14/7167.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/mysql/mariadb.py
lib/sqlalchemy/dialects/mysql/mariadbconnector.py
lib/sqlalchemy/dialects/mysql/mysqldb.py
lib/sqlalchemy/dialects/mysql/reserved_words.py [new file with mode: 0644]
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_dialect.py