[openjpa] branch master updated: OPENJPA-2868 fix invalidColumnNames for MySQL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[openjpa] branch master updated: OPENJPA-2868 fix invalidColumnNames for MySQL

This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

The following commit(s) were added to refs/heads/master by this push:
     new b99e2db  OPENJPA-2868 fix invalidColumnNames for MySQL
b99e2db is described below

commit b99e2dba29aa41bfe30ede461feb8c6ebd3801a5
Author: Mark Struberg <[hidden email]>
AuthorDate: Sun May 2 16:11:56 2021 +0200

    OPENJPA-2868 fix invalidColumnNames for MySQL
 .../apache/openjpa/jdbc/sql/MySQLDictionary.java   | 47 +++++++++++++---------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
index 31aa326..988f058 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
@@ -133,26 +133,33 @@ public class MySQLDictionary
         // 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",
-            "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",
-            "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-02T15:40:16.383 via org.apache.openjpa.reservedwords.ReservedWordsIT
+        invalidColumnWordSet.addAll(Arrays.asList(new String[] {
+            "IN", "INDEX", "INFILE", "INNER", "INOUT", "INSENSITIVE", "INSERT", "INT", "INT1", "INT2", "INT3", "INT4", "INT8",
+            "INTEGER", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LEADING", "LEAVE", "LEFT", "LIKE",
+            // 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
+            "INDEX", "SELECT"
         requiresSearchStringEscapeForLike = true;