From 5dc56fa17b54cb9762f536e9ba42411c62baa9ed Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Sun, 2 May 2021 17:14:58 +0200 Subject: [PATCH] OPENJPA-2868 update invalidColumnNames for MariaDB --- .../openjpa/jdbc/sql/MariaDBDictionary.java | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java index 78d608f85..ada65b307 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java @@ -136,26 +136,34 @@ public class MariaDBDictionary extends DBDictionary { // reservedWordSet subset that CANNOT be used as valid column names // (i.e., without surrounding them with double-quotes) - invalidColumnWordSet.addAll(Arrays.asList(new String[]{ - "ADD", "ALL", "ALTER", "AND", "AS", "ASC", "BETWEEN", "BINARY", - "BLOB", "BOTH", "BY", "CASCADE", "CASE", "CHANGE", "CHAR", - "CHARACTER", "CHECK", "COLLATE", "COLUMN", "CONSTRAINT", "CONTINUE", - "CONVERT", "CREATE", "CROSS", "CURRENT_DATE", "CURRENT_TIME", - "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "DEC", "DECIMAL", - "DECLARE", "DEFAULT", "DELETE", "DESC", "DESCRIBE", "DISTINCT", - "DOUBLE", "DROP", "ELSE", "END-EXEC", "EXISTS", "FALSE", "FETCH", - "FLOAT", "FLOAT4", "FOR", "FOREIGN", "FROM", "GRANT", "GROUP", - "HAVING", "IN", "INFILE", "INNER", "INSENSITIVE", "INSERT", "INT", - "INT1", "INT2", "INT4", "INTEGER", "INTERVAL", "INTO", "IS", "JOIN", - "KEY", "LEADING", "LEFT", "LIKE", "LOAD", "MATCH", "MEDIUMINT", - "NATURAL", "NOT", "NULL", "NUMERIC", "ON", "OPTION", "OR", "ORDER", - "OUTER", "OUTFILE", "PRECISION", "PRIMARY", "PROCEDURE", "READ", - "REAL", "REFERENCES", "REPLACE", "RESTRICT", "REVOKE", "RIGHT", - "SCHEMA", "SELECT", "SET", "SMALLINT", "SQL", "SQLSTATE", - "STARTING", "TABLE", "THEN", "TO", "TRAILING", "TRUE", "UNION", - "UNIQUE", "UNSIGNED", "UPDATE", "USAGE", "USING", "VALUES", - "VARCHAR", "VARYING", "WHEN", "WHERE", "WITH", "WRITE", "ZEROFILL", - "INDEX", + // generated at 2021-05-02T16:53:15.561 via org.apache.openjpa.reservedwords.ReservedWordsIT + invalidColumnWordSet.addAll(Arrays.asList(new String[] { + "ADD", "ALL", "ALTER", "ANALYZE", "AND", "AS", "ASC", "ASENSITIVE", "BEFORE", "BETWEEN", "BIGINT", "BINARY", + "BLOB", "BOTH", "BY", "CALL", "CASCADE", "CASE", "CHANGE", "CHAR", "CHARACTER", "CHECK", "COLLATE", "COLUMN", "CONDITION", + "CONSTRAINT", "CONTINUE", "CONVERT", "CREATE", "CROSS", "CURRENT_DATE", "CURRENT_ROLE", "CURRENT_TIME", "CURRENT_TIMESTAMP", + "CURRENT_USER", "CURSOR", "DATABASE", "DATABASES", "DAY_HOUR", "DAY_MICROSECOND", "DAY_MINUTE", "DAY_SECOND", "DEC", + "DECIMAL", "DECLARE", "DEFAULT", "DELAYED", "DELETE", "DESC", "DESCRIBE", "DETERMINISTIC", "DISTINCT", "DISTINCTROW", + "DIV", "DOUBLE", "DROP", "DUAL", "EACH", "ELSE", "ELSEIF", "ENCLOSED", "END-EXEC", "ESCAPED", "EXCEPT", "EXISTS", + "EXIT", "EXPLAIN", "FALSE", "FETCH", "FLOAT", "FLOAT4", "FLOAT8", "FOR", "FORCE", "FOREIGN", "FROM", "FULLTEXT", + "GRANT", "GROUP", "HAVING", "HIGH_PRIORITY", "HOUR_MICROSECOND", "HOUR_MINUTE", "HOUR_SECOND", "IF", "IGNORE", + "IN", "INDEX", "INFILE", "INNER", "INOUT", "INSENSITIVE", "INSERT", "INT", "INT1", "INT2", "INT3", "INT4", "INT8", + "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LEADING", "LEAVE", + "LEFT", "LIKE", "LIMIT", "LINES", "LOAD", "LOCALTIME", "LOCALTIMESTAMP", "LOCK", "LONG", "LONGBLOB", "LONGTEXT", + "LOOP", "LOW_PRIORITY", "MATCH", "MAXVALUE", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MIDDLEINT", "MINUTE_MICROSECOND", + "MINUTE_SECOND", "MOD", "MODIFIES", "NATURAL", "NO_WRITE_TO_BINLOG", "NOT", "NULL", "NUMERIC", "ON", "OPTIMIZE", + "OPTIONALLY", "OR", "ORDER", "OUT", "OUTER", "OUTFILE", "OVER", "PARTITION", "PRECISION", "PRIMARY", "PROCEDURE", + "PURGE", "RANGE", "READ", "READS", "REAL", "RECURSIVE", "REFERENCES", "REGEXP", "RELEASE", "RENAME", "REPEAT", + "REPLACE", "REQUIRE", "RESIGNAL", "RESTRICT", "RETURN", "REVOKE", "RIGHT", "RLIKE", "ROWS", "SCHEMA", "SCHEMAS", + "SECOND_MICROSECOND", "SENSITIVE", "SEPARATOR", "SET", "SHOW", "SIGNAL", "SMALLINT", "SPATIAL", "SPECIFIC", "SQL", + "SQL_BIG_RESULT", "SQL_CALC_FOUND_ROWS", "SQL_SMALL_RESULT", "SQLEXCEPTION", "SQLSTATE", "SQLWARNING", "SSL", "STARTING", + "STRAIGHT_JOIN", "TABLE", "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", "WHERE", "WHILE", "WITH", + "WRITE", "XOR", "YEAR_MONTH", "ZEROFILL", + // end generated. + // the following keywords used to be defined as reserved words in the past, but now seem to work + // we still add them for compat reasons + "OPTION", "SELECT", })); requiresSearchStringEscapeForLike = true;