From 3d3f4134eda3e97caf2de21ee482f92e8d6aa151 Mon Sep 17 00:00:00 2001 From: Leopold Jacquot Date: Wed, 15 Jan 2025 12:49:33 +0100 Subject: [PATCH] fix: add missing MySQL 8.4 reserved keywords Signed-off-by: Leopold Jacquot --- go/vt/sqlparser/testdata/mysql_keywords.txt | 54 ++++++++++++++++++- .../jdbc/VitessMySQLDatabaseMetadata.java | 8 +-- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/go/vt/sqlparser/testdata/mysql_keywords.txt b/go/vt/sqlparser/testdata/mysql_keywords.txt index 9e5c6eab6d8..dc24fe94c0a 100644 --- a/go/vt/sqlparser/testdata/mysql_keywords.txt +++ b/go/vt/sqlparser/testdata/mysql_keywords.txt @@ -1,5 +1,5 @@ // Code generated by `SELECT * FROM INFORMATION_SCHEMA.KEYWORDS`. -// Reference: https://dev.mysql.com/doc/refman/8.0/en/information-schema-keywords-table.html +// Reference: https://dev.mysql.com/doc/refman/8.4/en/information-schema-keywords-table.html // DO NOT EDIT. WORD RESERVED ACCESSIBLE 1 @@ -23,8 +23,11 @@ AS 1 ASC 1 ASCII 0 ASENSITIVE 1 +ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS 0 AT 0 ATTRIBUTE 0 +AUTHENTICATION 0 +AUTO 0 AUTOEXTEND_SIZE 0 AUTO_INCREMENT 0 AVG 0 @@ -32,6 +35,7 @@ AVG_ROW_LENGTH 0 BACKUP 0 BEFORE 1 BEGIN 0 +BERNOULLI 0 BETWEEN 1 BIGINT 1 BINARY 1 @@ -44,6 +48,7 @@ BOOLEAN 0 BOTH 1 BTREE 0 BUCKETS 0 +BULK 0 BY 1 BYTE 0 CACHE 0 @@ -53,6 +58,7 @@ CASCADED 0 CASE 1 CATALOG_NAME 0 CHAIN 0 +CHALLENGE_RESPONSE 0 CHANGE 1 CHANGED 0 CHANNEL 0 @@ -181,6 +187,7 @@ EXPLAIN 1 EXPORT 0 EXTENDED 0 EXTENT_SIZE 0 +FACTOR 0 FAILED_LOGIN_ATTEMPTS 0 FALSE 1 FAST 0 @@ -190,6 +197,7 @@ FIELDS 0 FILE 0 FILE_BLOCK_SIZE 0 FILTER 0 +FINISH 0 FIRST 0 FIRST_VALUE 1 FIXED 0 @@ -209,6 +217,7 @@ FULL 0 FULLTEXT 1 FUNCTION 1 GENERAL 0 +GENERATE 0 GENERATED 1 GEOMCOLLECTION 0 GEOMETRY 0 @@ -216,6 +225,7 @@ GEOMETRYCOLLECTION 0 GET 1 GET_FORMAT 0 GET_MASTER_PUBLIC_KEY 0 +GET_SOURCE_PUBLIC_KEY 0 GLOBAL 0 GRANT 1 GRANTS 0 @@ -223,6 +233,8 @@ GROUP 1 GROUPING 1 GROUPS 1 GROUP_REPLICATION 0 +GTIDS 0 +GTID_ONLY 0 HANDLER 0 HASH 0 HAVING 1 @@ -246,7 +258,9 @@ INACTIVE 0 INDEX 1 INDEXES 0 INFILE 1 +INITIAL 0 INITIAL_SIZE 0 +INITIATE 0 INNER 1 INOUT 1 INSENSITIVE 1 @@ -261,6 +275,7 @@ INT3 1 INT4 1 INT8 1 INTEGER 1 +INTERSECT 1 INTERVAL 1 INTO 1 INVISIBLE 0 @@ -279,6 +294,7 @@ JSON 0 JSON_TABLE 1 JSON_VALUE 0 KEY 1 +KEYRING 0 KEYS 1 KEY_BLOCK_SIZE 0 KILL 1 @@ -307,6 +323,7 @@ LOCALTIMESTAMP 1 LOCK 1 LOCKED 0 LOCKS 0 +LOG 0 LOGFILE 0 LOGS 0 LONG 1 @@ -314,6 +331,7 @@ LONGBLOB 1 LONGTEXT 1 LOOP 1 LOW_PRIORITY 1 +MANUAL 0 MASTER 0 MASTER_AUTO_POSITION 0 MASTER_BIND 1 @@ -428,7 +446,9 @@ OVER 1 OWNER 0 PACK_KEYS 0 PAGE 0 +PARALLEL 0 PARSER 0 +PARSE_TREE 0 PARTIAL 0 PARTITION 1 PARTITIONING 0 @@ -462,6 +482,7 @@ PROFILE 0 PROFILES 0 PROXY 0 PURGE 1 +QUALIFY 0 QUARTER 0 QUERY 0 QUICK 0 @@ -481,6 +502,7 @@ REDUNDANT 0 REFERENCE 0 REFERENCES 1 REGEXP 1 +REGISTRATION 0 RELAY 0 RELAYLOG 0 RELAY_LOG_FILE 0 @@ -537,6 +559,7 @@ ROW_COUNT 0 ROW_FORMAT 0 ROW_NUMBER 1 RTREE 0 +S3 0 SAVEPOINT 0 SCHEDULE 0 SCHEMA 1 @@ -574,7 +597,33 @@ SOME 0 SONAME 0 SOUNDS 0 SOURCE 0 +SOURCE_AUTO_POSITION 0 +SOURCE_BIND 0 +SOURCE_COMPRESSION_ALGORITHMS 0 SOURCE_CONNECTION_AUTO_FAILOVER 0 +SOURCE_CONNECT_RETRY 0 +SOURCE_DELAY 0 +SOURCE_HEARTBEAT_PERIOD 0 +SOURCE_HOST 0 +SOURCE_LOG_FILE 0 +SOURCE_LOG_POS 0 +SOURCE_PASSWORD 0 +SOURCE_PORT 0 +SOURCE_PUBLIC_KEY_PATH 0 +SOURCE_RETRY_COUNT 0 +SOURCE_SSL 0 +SOURCE_SSL_CA 0 +SOURCE_SSL_CAPATH 0 +SOURCE_SSL_CERT 0 +SOURCE_SSL_CIPHER 0 +SOURCE_SSL_CRL 0 +SOURCE_SSL_CRLPATH 0 +SOURCE_SSL_KEY 0 +SOURCE_SSL_VERIFY_SERVER_CERT 0 +SOURCE_TLS_CIPHERSUITES 0 +SOURCE_TLS_VERSION 0 +SOURCE_USER 0 +SOURCE_ZSTD_COMPRESSION_LEVEL 0 SPATIAL 1 SPECIFIC 1 SQL 1 @@ -625,6 +674,7 @@ SWITCHES 0 SYSTEM 1 TABLE 1 TABLES 0 +TABLESAMPLE 0 TABLESPACE 0 TABLE_CHECKSUM 0 TABLE_NAME 0 @@ -665,10 +715,12 @@ UNION 1 UNIQUE 1 UNKNOWN 0 UNLOCK 1 +UNREGISTER 0 UNSIGNED 1 UNTIL 0 UPDATE 1 UPGRADE 0 +URL 0 USAGE 1 USE 1 USER 0 diff --git a/java/jdbc/src/main/java/io/vitess/jdbc/VitessMySQLDatabaseMetadata.java b/java/jdbc/src/main/java/io/vitess/jdbc/VitessMySQLDatabaseMetadata.java index 0235393a2c9..f29143003d5 100644 --- a/java/jdbc/src/main/java/io/vitess/jdbc/VitessMySQLDatabaseMetadata.java +++ b/java/jdbc/src/main/java/io/vitess/jdbc/VitessMySQLDatabaseMetadata.java @@ -67,16 +67,16 @@ public class VitessMySQLDatabaseMetadata extends VitessDatabaseMetaData implemen "INNER", "INOUT", "INSENSITIVE", "INSERT", "INT", "INT1", "INT2", "INT3", "INT4", "INT8", "INTEGER", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LEADING", "LEAVE", "LEFT", "LIKE", "LIMIT", "LINEAR", "LINES", "LOAD", "LOCALTIME", "LOCALTIMESTAMP", - "LOCK", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY", "MATCH", "MEDIUMBLOB", + "LOCK", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY", "MANUAL", "MATCH", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MIDDLEINT", "MINUTE_MICROSECOND", "MINUTE_SECOND", "MOD", "MODIFIES", "NATURAL", "NOT", "NO_WRITE_TO_BINLOG", "NULL", "NUMERIC", "ON", "OPTIMIZE", - "OPTION", "OPTIONALLY", "OR", "ORDER", "OUT", "OUTER", "OUTFILE", "PRECISION", "PRIMARY", - "PROCEDURE", "PURGE", "RANGE", "READ", "READS", "READ_ONLY", "READ_WRITE", "REAL", + "OPTION", "OPTIONALLY", "OR", "ORDER", "OUT", "OUTER", "OUTFILE", "PARALLEL", "PRECISION", "PRIMARY", + "PROCEDURE", "PURGE", "QUALIFY", "RANGE", "READ", "READS", "READ_ONLY", "READ_WRITE", "REAL", "REFERENCES", "REGEXP", "RELEASE", "RENAME", "REPEAT", "REPLACE", "REQUIRE", "RESTRICT", "RETURN", "REVOKE", "RIGHT", "RLIKE", "SCHEMA", "SCHEMAS", "SECOND_MICROSECOND", "SELECT", "SENSITIVE", "SEPARATOR", "SET", "SHOW", "SMALLINT", "SPATIAL", "SPECIFIC", "SQL", "SQLEXCEPTION", "SQLSTATE", "SQLWARNING", "SQL_BIG_RESULT", "SQL_CALC_FOUND_ROWS", - "SQL_SMALL_RESULT", "SSL", "STARTING", "STRAIGHT_JOIN", "TABLE", "TERMINATED", "THEN", + "SQL_SMALL_RESULT", "SSL", "STARTING", "STRAIGHT_JOIN", "TABLE", "TABLESAMPLE", "TERMINATED", "THEN", "TINYBLOB", "TINYINT", "TINYTEXT", "TO", "TRAILING", "TRIGGER", "TRUE", "UNDO", "UNION", "UNIQUE", "UNLOCK", "UNSIGNED", "UPDATE", "USAGE", "USE", "USING", "UTC_DATE", "UTC_TIME", "UTC_TIMESTAMP", "VALUES", "VARBINARY", "VARCHAR", "VARCHARACTER", "VARYING", "WHEN",