From 57cfd48b738001ed6908fb1924cfcde05fa9da88 Mon Sep 17 00:00:00 2001 From: XudongXie Date: Thu, 12 Sep 2024 23:17:22 +0800 Subject: [PATCH] add alter table keywords --- sqlTranslate/.idea/workspace.xml | 17 ++++++++++++----- .../src/main/java/Lexer/OracleLexer.java | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sqlTranslate/.idea/workspace.xml b/sqlTranslate/.idea/workspace.xml index 02dd6433e..84a3005ad 100644 --- a/sqlTranslate/.idea/workspace.xml +++ b/sqlTranslate/.idea/workspace.xml @@ -4,8 +4,8 @@ - @@ -479,7 +485,8 @@ - diff --git a/sqlTranslate/src/main/java/Lexer/OracleLexer.java b/sqlTranslate/src/main/java/Lexer/OracleLexer.java index 39e2987c2..c45153568 100644 --- a/sqlTranslate/src/main/java/Lexer/OracleLexer.java +++ b/sqlTranslate/src/main/java/Lexer/OracleLexer.java @@ -16,13 +16,15 @@ public class OracleLexer { "LONG RAW", "BOOLEAN", "INTERVAL YEAR TO MONTH", "INTERVAL DAY TO SECOND", "ROWID", "UROWID", "REF CURSOR", "NOT NULL", "PRIMARY KEY", "UNIQUE", "CHECK", "REFERENCES", "DEFAULT", "CONSTRAINT", "FOREIGN KEY" // keywords of drop table - , "DROP", "CASCADE", "CONSTRAINTS" + , "DROP", "CASCADE" // keywords of select , "DISTINCT", "JOIN", "GROUP BY", "ORDER BY", "HAVING", "UNION", "CASE", "WHEN", "END", "AS" // keywords of join , "INNER JOIN", "LEFT JOIN", "LEFT OUTER JOIN", "RIGHT JOIN", "RIGHT OUTER JOIN", "FULL JOIN", "FULL OUTER JOIN", "CROSS JOIN", "JOIN", "ON", "USING" // keywords of update , "SET" + // keywords of alter table + , "ALTER", "ADD", "DROP", "MODIFY", "RENAME", "TO" }; private static final Pattern TOKEN_PATTERN = Pattern.compile( "(NUMBER\\(.*?\\))|" + // NUMBER() function