Skip to content

Commit aef6e62

Browse files
zzzeekGerrit Code Review
authored andcommitted
Merge "Add ARRAY and MEMBER to MySQL reserved words"
2 parents 33616a8 + d08d27b commit aef6e62

2 files changed

Lines changed: 69 additions & 60 deletions

File tree

  • doc/build/changelog/unreleased_13
  • lib/sqlalchemy/dialects/mysql
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. change::
2+
:tags: usecase, mysql
3+
:tickets: 4783
4+
5+
Added reserved words ARRAY and MEMBER to the MySQL reserved words list, as
6+
MySQL 8.0 has now made these reserved.
7+

‎lib/sqlalchemy/dialects/mysql/base.py‎

Lines changed: 62 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -802,12 +802,15 @@ def process(element, compiler, **kw):
802802

803803
RESERVED_WORDS = set(
804804
[
805+
"accessible",
805806
"accessible",
806807
"add",
808+
"admin",
807809
"all",
808810
"alter",
809811
"analyze",
810812
"and",
813+
"array", # 8.0
811814
"as",
812815
"asc",
813816
"asensitive",
@@ -827,12 +830,14 @@ def process(element, compiler, **kw):
827830
"check",
828831
"collate",
829832
"column",
833+
"columns",
830834
"condition",
831835
"constraint",
832836
"continue",
833837
"convert",
834838
"create",
835839
"cross",
840+
"cume_dist",
836841
"current_date",
837842
"current_time",
838843
"current_timestamp",
@@ -862,13 +867,17 @@ def process(element, compiler, **kw):
862867
"each",
863868
"else",
864869
"elseif",
870+
"empty",
865871
"enclosed",
866872
"escaped",
873+
"except",
867874
"exists",
868875
"exit",
869876
"explain",
870877
"false",
871878
"fetch",
879+
"fields",
880+
"first_value",
872881
"float",
873882
"float4",
874883
"float8",
@@ -877,15 +886,22 @@ def process(element, compiler, **kw):
877886
"foreign",
878887
"from",
879888
"fulltext",
889+
"function",
890+
"general",
891+
"generated",
892+
"get",
880893
"grant",
881894
"group",
895+
"grouping",
896+
"groups",
882897
"having",
883898
"high_priority",
884899
"hour_microsecond",
885900
"hour_minute",
886901
"hour_second",
887902
"if",
888903
"ignore",
904+
"ignore_server_ids",
889905
"in",
890906
"index",
891907
"infile",
@@ -902,18 +918,23 @@ def process(element, compiler, **kw):
902918
"integer",
903919
"interval",
904920
"into",
921+
"io_after_gtids",
922+
"io_before_gtids",
905923
"is",
906924
"iterate",
907925
"join",
926+
"json_table",
908927
"key",
909928
"keys",
910929
"kill",
930+
"last_value",
911931
"leading",
912932
"leave",
913933
"left",
914934
"like",
915935
"limit",
916936
"linear",
937+
"linear",
917938
"lines",
918939
"load",
919940
"localtime",
@@ -924,52 +945,78 @@ def process(element, compiler, **kw):
924945
"longtext",
925946
"loop",
926947
"low_priority",
948+
"master_bind",
949+
"master_heartbeat_period",
950+
"master_ssl_verify_server_cert",
927951
"master_ssl_verify_server_cert",
928952
"match",
953+
"maxvalue",
929954
"mediumblob",
930955
"mediumint",
931956
"mediumtext",
957+
"member", # 8.0
932958
"middleint",
933959
"minute_microsecond",
934960
"minute_second",
935961
"mod",
936962
"modifies",
937963
"natural",
938-
"not",
939964
"no_write_to_binlog",
965+
"not",
966+
"nth_value",
967+
"ntile",
940968
"null",
941969
"numeric",
970+
"of",
942971
"on",
972+
"one_shot",
943973
"optimize",
974+
"optimizer_costs",
944975
"option",
945976
"optionally",
946977
"or",
947978
"order",
948979
"out",
949980
"outer",
950981
"outfile",
982+
"over",
983+
"partition",
984+
"percent_rank",
985+