From: Mike Bayer Date: Sat, 27 Jul 2019 14:43:59 +0000 (-0400) Subject: Add ARRAY and MEMBER to MySQL reserved words X-Git-Tag: rel_1_3_7~17^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9abec017430b2c17f2bcfb94670899f2586036b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add ARRAY and MEMBER to MySQL reserved words Also sort the listing of reserved words. Fixes: #4783 Change-Id: I8a7370a424d7c78efb4916d3307600b8e85f98ac (cherry picked from commit d08d27b897569ff8f18ca869b00a058652111c24) --- diff --git a/doc/build/changelog/unreleased_13/4783.rst b/doc/build/changelog/unreleased_13/4783.rst new file mode 100644 index 0000000000..983fa88279 --- /dev/null +++ b/doc/build/changelog/unreleased_13/4783.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: usecase, mysql + :tickets: 4783 + + Added reserved words ARRAY and MEMBER to the MySQL reserved words list, as + MySQL 8.0 has now made these reserved. + diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 77699b81b9..d8013eb70a 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -800,12 +800,15 @@ from ...util import topological RESERVED_WORDS = set( [ + "accessible", "accessible", "add", + "admin", "all", "alter", "analyze", "and", + "array", # 8.0 "as", "asc", "asensitive", @@ -825,12 +828,14 @@ RESERVED_WORDS = set( "check", "collate", "column", + "columns", "condition", "constraint", "continue", "convert", "create", "cross", + "cume_dist", "current_date", "current_time", "current_timestamp", @@ -860,13 +865,17 @@ RESERVED_WORDS = set( "each", "else", "elseif", + "empty", "enclosed", "escaped", + "except", "exists", "exit", "explain", "false", "fetch", + "fields", + "first_value", "float", "float4", "float8", @@ -875,8 +884,14 @@ RESERVED_WORDS = set( "foreign", "from", "fulltext", + "function", + "general", + "generated", + "get", "grant", "group", + "grouping", + "groups", "having", "high_priority", "hour_microsecond", @@ -884,6 +899,7 @@ RESERVED_WORDS = set( "hour_second", "if", "ignore", + "ignore_server_ids", "in", "index", "infile", @@ -900,18 +916,23 @@ RESERVED_WORDS = set( "integer", "interval", "into", + "io_after_gtids", + "io_before_gtids", "is", "iterate", "join", + "json_table", "key", "keys", "kill", + "last_value", "leading", "leave", "left", "like", "limit", "linear", + "linear", "lines", "load", "localtime", @@ -922,23 +943,33 @@ RESERVED_WORDS = set( "longtext", "loop", "low_priority", + "master_bind", + "master_heartbeat_period", + "master_ssl_verify_server_cert", "master_ssl_verify_server_cert", "match", + "maxvalue", "mediumblob", "mediumint", "mediumtext", + "member", # 8.0 "middleint", "minute_microsecond", "minute_second", "mod", "modifies", "natural", - "not", "no_write_to_binlog", + "not", + "nth_value", + "ntile", "null", "numeric", + "of", "on", + "one_shot", "optimize", + "optimizer_costs", "option", "optionally", "or", @@ -946,16 +977,27 @@ RESERVED_WORDS = set( "out", "outer", "outfile", + "over", + "partition", + "percent_rank", + "persist", + "persist_only", "precision", "primary", + "privileges", "procedure", "purge", "range", + "range", + "rank", "read", - "reads", + "read_only", "read_only", "read_write", + "read_write", # 5.1 + "reads", "real", + "recursive", "references", "regexp", "release", @@ -963,11 +1005,16 @@ RESERVED_WORDS = set( "repeat", "replace", "require", + "resignal", "restrict", "return", "revoke", "right", "rlike", + "role", + "row", + "row_number", + "rows", "schema", "schemas", "second_microsecond", @@ -976,20 +1023,28 @@ RESERVED_WORDS = set( "separator", "set", "show", + "signal", + "slow", # 5.5 "smallint", + "soname", "spatial", "specific", "sql", - "sqlexception", - "sqlstate", - "sqlwarning", + "sql_after_gtids", + "sql_before_gtids", # 5.6 "sql_big_result", "sql_calc_found_rows", "sql_small_result", + "sqlexception", + "sqlstate", + "sqlwarning", "ssl", "starting", + "stored", "straight_join", + "system", "table", + "tables", # 4.1 "terminated", "then", "tinyblob", @@ -1016,70 +1071,17 @@ RESERVED_WORDS = set( "varchar", "varcharacter", "varying", + "virtual", # 5.7 "when", "where", "while", + "window", # 8.0 "with", "write", "x509", "xor", "year_month", "zerofill", # 5.0 - "columns", - "fields", - "privileges", - "soname", - "tables", # 4.1 - "accessible", - "linear", - "master_ssl_verify_server_cert", - "range", - "read_only", - "read_write", # 5.1 - "general", - "ignore_server_ids", - "master_heartbeat_period", - "maxvalue", - "resignal", - "signal", - "slow", # 5.5 - "get", - "io_after_gtids", - "io_before_gtids", - "master_bind", - "one_shot", - "partition", - "sql_after_gtids", - "sql_before_gtids", # 5.6 - "generated", - "optimizer_costs", - "stored", - "virtual", # 5.7 - "admin", - "cume_dist", - "empty", - "except", - "first_value", - "grouping", - "function", - "groups", - "json_table", - "last_value", - "nth_value", - "ntile", - "of", - "over", - "percent_rank", - "persist", - "persist_only", - "rank", - "recursive", - "role", - "row", - "rows", - "row_number", - "system", - "window", # 8.0 ] )