Skip to content

Commit

Permalink
For issue #540.
Browse files Browse the repository at this point in the history
  • Loading branch information
haocao committed Jan 18, 2018
1 parent 6a0d981 commit 978cbf2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public Optional<String> parseTableAlias() {

private TokenType[] getDefaultAvailableKeywordsForTableAlias() {
return new TokenType[] {
Literals.IDENTIFIER, Literals.CHARS, DefaultKeyword.SEQUENCE, DefaultKeyword.NO, DefaultKeyword.WITHOUT, DefaultKeyword.TEMPORARY,
DefaultKeyword.TEMP, DefaultKeyword.AFTER, DefaultKeyword.INSTEAD, DefaultKeyword.STATEMENT, DefaultKeyword.BITMAP, DefaultKeyword.NOSORT, DefaultKeyword.REVERSE,
Literals.IDENTIFIER, Literals.CHARS, DefaultKeyword.SEQUENCE, DefaultKeyword.NO,
DefaultKeyword.AFTER, DefaultKeyword.BITMAP, DefaultKeyword.NOSORT, DefaultKeyword.REVERSE,
DefaultKeyword.COMPILE, DefaultKeyword.ENABLE, DefaultKeyword.DISABLE, DefaultKeyword.NEW, DefaultKeyword.UNTIL, DefaultKeyword.ADVISE, DefaultKeyword.PASSWORD,
DefaultKeyword.LOCAL, DefaultKeyword.GLOBAL, DefaultKeyword.STORAGE, DefaultKeyword.DATA, DefaultKeyword.TIME, DefaultKeyword.BOOLEAN, DefaultKeyword.GREATEST,
DefaultKeyword.LEAST, DefaultKeyword.ROUND, DefaultKeyword.TRUNC, DefaultKeyword.POSITION, DefaultKeyword.LENGTH, DefaultKeyword.CHAR_LENGTH, DefaultKeyword.SUBSTRING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ protected TokenType[] getCustomizedAvailableKeywordsForSelectItemAlias() {
@Override
protected TokenType[] getCustomizedAvailableKeywordsForTableAlias() {
return new TokenType[]{
DefaultKeyword.VIEW, DefaultKeyword.FUNCTION, DefaultKeyword.OF, DefaultKeyword.DO, DefaultKeyword.COMMENT, DefaultKeyword.ROW, DefaultKeyword.EXECUTE, DefaultKeyword.MODIFY,
DefaultKeyword.VALIDATE, DefaultKeyword.USER, DefaultKeyword.IDENTIFIED, DefaultKeyword.TRUNCATE, DefaultKeyword.END, DefaultKeyword.FULL, DefaultKeyword.CLOSE, DefaultKeyword.CAST,
DefaultKeyword.FUNCTION, DefaultKeyword.COMMENT, DefaultKeyword.ROW, DefaultKeyword.EXECUTE, DefaultKeyword.MODIFY,
DefaultKeyword.VALIDATE, DefaultKeyword.USER, DefaultKeyword.IDENTIFIED, DefaultKeyword.END, DefaultKeyword.CLOSE, DefaultKeyword.CAST,
DefaultKeyword.ESCAPE, DefaultKeyword.SOME, DefaultKeyword.OPEN, DefaultKeyword.OVER, DefaultKeyword.COALESCE, DefaultKeyword.VARCHAR2, DefaultKeyword.DATE, DefaultKeyword.ANY,
MySQLKeyword.OFFSET, MySQLKeyword.VALUE, MySQLKeyword.BEGIN, MySQLKeyword.QUICK, MySQLKeyword.CACHE, MySQLKeyword.SQL_CACHE, MySQLKeyword.SQL_NO_CACHE, MySQLKeyword.SQL_BUFFER_RESULT,
MySQLKeyword.OFFSET, MySQLKeyword.BEGIN, MySQLKeyword.QUICK, MySQLKeyword.CACHE, MySQLKeyword.SQL_CACHE, MySQLKeyword.SQL_NO_CACHE, MySQLKeyword.SQL_BUFFER_RESULT,
MySQLKeyword.FIRST, MySQLKeyword.ALGORITHM, MySQLKeyword.DISCARD, MySQLKeyword.IMPORT, MySQLKeyword.VALIDATION, MySQLKeyword.REORGANIZE, MySQLKeyword.EXCHANGE, MySQLKeyword.REBUILD,
MySQLKeyword.REPAIR, MySQLKeyword.UPGRADE, MySQLKeyword.KEY_BLOCK_SIZE, MySQLKeyword.AUTO_INCREMENT, MySQLKeyword.AVG_ROW_LENGTH, MySQLKeyword.CHECKSUM,
MySQLKeyword.REPAIR, MySQLKeyword.KEY_BLOCK_SIZE, MySQLKeyword.AUTO_INCREMENT, MySQLKeyword.AVG_ROW_LENGTH, MySQLKeyword.CHECKSUM,
MySQLKeyword.COMPRESSION, MySQLKeyword.CONNECTION, MySQLKeyword.DIRECTORY, MySQLKeyword.DELAY_KEY_WRITE, MySQLKeyword.ENCRYPTION, MySQLKeyword.ENGINE, MySQLKeyword.INSERT_METHOD,
MySQLKeyword.MAX_ROWS, MySQLKeyword.MIN_ROWS, MySQLKeyword.PACK_KEYS, MySQLKeyword.ROW_FORMAT, MySQLKeyword.DYNAMIC, MySQLKeyword.FIXED, MySQLKeyword.COMPRESSED, MySQLKeyword.REDUNDANT,
MySQLKeyword.COMPACT, MySQLKeyword.STATS_AUTO_RECALC, MySQLKeyword.STATS_PERSISTENT, MySQLKeyword.STATS_SAMPLE_PAGES, MySQLKeyword.DISK, MySQLKeyword.MEMORY, MySQLKeyword.ROLLUP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@ protected TokenType[] getCustomizedAvailableKeywordsForSelectItemAlias() {

@Override
protected TokenType[] getCustomizedAvailableKeywordsForTableAlias() {
return new TokenType[0];
return new TokenType[] {
DefaultKeyword.PROCEDURE, DefaultKeyword.FUNCTION, DefaultKeyword.CURSOR, DefaultKeyword.TRUE, DefaultKeyword.FALSE, DefaultKeyword.REPLACE, DefaultKeyword.BEFORE,
DefaultKeyword.EACH, DefaultKeyword.EXECUTE, DefaultKeyword.FULLTEXT, DefaultKeyword.CASE, DefaultKeyword.WHEN, DefaultKeyword.END, DefaultKeyword.USE,
DefaultKeyword.NATURAL, DefaultKeyword.DECLARE, DefaultKeyword.FETCH, DefaultKeyword.CLOSE, DefaultKeyword.CAST, DefaultKeyword.ESCAPE,
DefaultKeyword.SOME, DefaultKeyword.LEAVE, DefaultKeyword.ITERATE, DefaultKeyword.REPEAT, DefaultKeyword.OPEN, DefaultKeyword.OUT, DefaultKeyword.INOUT,
DefaultKeyword.OVER, DefaultKeyword.LOOP, DefaultKeyword.EXPLAIN, DefaultKeyword.COALESCE, DefaultKeyword.CHARACTER, DefaultKeyword.VARYING, DefaultKeyword.INT,
DefaultKeyword.DEC, DefaultKeyword.NUMERIC, DefaultKeyword.REAL, DefaultKeyword.DOUBLE, DefaultKeyword.PRECISION, DefaultKeyword.INTERVAL, DefaultKeyword.BLOB,
DefaultKeyword.XOR, DefaultKeyword.BOTH, DefaultKeyword.LEADING, DefaultKeyword.TRAILING, DefaultKeyword.CONVERT, DefaultKeyword.CONSTRAINT, DefaultKeyword.PRIMARY,
DefaultKeyword.FOREIGN, DefaultKeyword.KEY, DefaultKeyword.REFERENCES,
OracleKeyword.LOCKED, OracleKeyword.COMMIT, OracleKeyword.CREATION, OracleKeyword.UPDATED, OracleKeyword.UPSERT, OracleKeyword.STORE, OracleKeyword.MERGE,
OracleKeyword.PURGE, OracleKeyword.GOTO, OracleKeyword.ONLY, OracleKeyword.AUTOMATIC, OracleKeyword.MAIN, OracleKeyword.PCTINCREASE, OracleKeyword.CHUNK,
OracleKeyword.LIMIT, OracleKeyword.GROUPING, OracleKeyword.ROLLUP, OracleKeyword.CUBE, OracleKeyword.UNLIMITED, OracleKeyword.SIBLINGS, OracleKeyword.INCLUDE,
OracleKeyword.EXCLUDE, OracleKeyword.PIVOT, OracleKeyword.UNPIVOT, OracleKeyword.EXCEPTION, OracleKeyword.EXCEPTIONS, OracleKeyword.ERRORS, OracleKeyword.DEFERRED,
OracleKeyword.NAV, OracleKeyword.VERSIONS, OracleKeyword.WAIT, OracleKeyword.CONTINUE, OracleKeyword.TIMESTAMP, OracleKeyword.SEGMENT, OracleKeyword.RETURN,
OracleKeyword.RETURNING, OracleKeyword.REJECT, OracleKeyword.MAXTRANS, OracleKeyword.MINEXTENTS, OracleKeyword.BEGIN, OracleKeyword.SAVEPOINT, OracleKeyword.MATCHED,
OracleKeyword.LOB, OracleKeyword.DIMENSION, OracleKeyword.FORCE, OracleKeyword.FIRST, OracleKeyword.NEXT, OracleKeyword.LAST, OracleKeyword.EXTRACT, OracleKeyword.RULES,
OracleKeyword.INITIALLY, OracleKeyword.KEEP, OracleKeyword.KEEP_DUPLICATES, OracleKeyword.REFERENCE, OracleKeyword.SEED, OracleKeyword.IGNORE, OracleKeyword.MEASURES,
OracleKeyword.LOGGING, OracleKeyword.MAXSIZE, OracleKeyword.FLASH_CACHE, OracleKeyword.CELL_FLASH_CACHE, OracleKeyword.SKIP, OracleKeyword.NONE, OracleKeyword.NULLS,
OracleKeyword.SINGLE, OracleKeyword.SCN, OracleKeyword.INITRANS, OracleKeyword.BLOCK, OracleKeyword.SEQUENTIAL, OracleKeyword.BINARY, OracleKeyword.INSENSITIVE,
OracleKeyword.SCROLL, OracleKeyword.XML, OracleKeyword.MINVALUE, OracleKeyword.MAXVALUE, OracleKeyword.CACHE, OracleKeyword.NOCACHE, OracleKeyword.CYCLE, OracleKeyword.NOCYCLE,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ protected TokenType[] getCustomizedAvailableKeywordsForSelectItemAlias() {
@Override
protected TokenType[] getCustomizedAvailableKeywordsForTableAlias() {
return new TokenType[] {
DefaultKeyword.SCHEMA, DefaultKeyword.DATABASE, DefaultKeyword.VIEW, DefaultKeyword.INDEX, DefaultKeyword.TRIGGER, DefaultKeyword.PROCEDURE, DefaultKeyword.FUNCTION,
DefaultKeyword.CURSOR, DefaultKeyword.OF, DefaultKeyword.WHILE, DefaultKeyword.BY, DefaultKeyword.COMMENT, DefaultKeyword.REPLACE, DefaultKeyword.BEFORE, DefaultKeyword.EACH,
DefaultKeyword.ROW, DefaultKeyword.EXECUTE, DefaultKeyword.FULLTEXT, DefaultKeyword.ALTER, DefaultKeyword.MODIFY, DefaultKeyword.IDENTIFIED,
DefaultKeyword.TRUNCATE, DefaultKeyword.INSERT, DefaultKeyword.VALUES, DefaultKeyword.UPDATE, DefaultKeyword.DELETE,
DefaultKeyword.USE, DefaultKeyword.DECLARE, DefaultKeyword.REVOKE, DefaultKeyword.CLOSE, DefaultKeyword.ESCAPE, DefaultKeyword.LOCK, DefaultKeyword.LEAVE, DefaultKeyword.ITERATE,
DefaultKeyword.REPEAT, DefaultKeyword.OPEN, DefaultKeyword.OUT, DefaultKeyword.INOUT, DefaultKeyword.OVER, DefaultKeyword.LOOP, DefaultKeyword.EXPLAIN, DefaultKeyword.COALESCE,
DefaultKeyword.CHAR, DefaultKeyword.CHARACTER, DefaultKeyword.VARYING, DefaultKeyword.VARCHAR, DefaultKeyword.VARCHAR2, DefaultKeyword.INTEGER, DefaultKeyword.INT,
DefaultKeyword.SMALLINT, DefaultKeyword.DECIMAL, DefaultKeyword.DEC, DefaultKeyword.NUMERIC, DefaultKeyword.FLOAT, DefaultKeyword.REAL, DefaultKeyword.DOUBLE, DefaultKeyword.PRECISION,
DefaultKeyword.DATE, DefaultKeyword.INTERVAL, DefaultKeyword.BLOB, DefaultKeyword.XOR, DefaultKeyword.BETWEEN, DefaultKeyword.EXISTS, DefaultKeyword.CONVERT, DefaultKeyword.KEY,
DefaultKeyword.TRIGGER, DefaultKeyword.PROCEDURE, DefaultKeyword.FUNCTION, DefaultKeyword.CURSOR, DefaultKeyword.BY, DefaultKeyword.COMMENT,
DefaultKeyword.REPLACE, DefaultKeyword.BEFORE, DefaultKeyword.EACH, DefaultKeyword.ROW, DefaultKeyword.EXECUTE, DefaultKeyword.FULLTEXT, DefaultKeyword.ALTER,
DefaultKeyword.MODIFY, DefaultKeyword.IDENTIFIED, DefaultKeyword.USE, DefaultKeyword.DECLARE, DefaultKeyword.REVOKE, DefaultKeyword.CLOSE, DefaultKeyword.ESCAPE,
DefaultKeyword.LOCK, DefaultKeyword.LEAVE, DefaultKeyword.ITERATE, DefaultKeyword.REPEAT, DefaultKeyword.OPEN, DefaultKeyword.OUT, DefaultKeyword.INOUT,
DefaultKeyword.OVER, DefaultKeyword.LOOP, DefaultKeyword.EXPLAIN, DefaultKeyword.COALESCE, DefaultKeyword.CHAR, DefaultKeyword.CHARACTER, DefaultKeyword.VARYING,
DefaultKeyword.VARCHAR, DefaultKeyword.VARCHAR2, DefaultKeyword.INTEGER, DefaultKeyword.INT, DefaultKeyword.SMALLINT, DefaultKeyword.DECIMAL, DefaultKeyword.DEC,
DefaultKeyword.NUMERIC, DefaultKeyword.FLOAT, DefaultKeyword.REAL, DefaultKeyword.DOUBLE, DefaultKeyword.PRECISION, DefaultKeyword.DATE, DefaultKeyword.INTERVAL,
DefaultKeyword.BLOB, DefaultKeyword.XOR, DefaultKeyword.BETWEEN, DefaultKeyword.EXISTS, DefaultKeyword.CONVERT, DefaultKeyword.KEY,
PostgreSQLKeyword.SHOW, PostgreSQLKeyword.FIRST, PostgreSQLKeyword.NEXT, PostgreSQLKeyword.LAST, PostgreSQLKeyword.RESTART, PostgreSQLKeyword.RECURSIVE, PostgreSQLKeyword.CURRENT,
PostgreSQLKeyword.NOWAIT, PostgreSQLKeyword.TYPE, PostgreSQLKeyword.UNLOGGED, PostgreSQLKeyword.CONTINUE, PostgreSQLKeyword.ROWS, PostgreSQLKeyword.SHARE,
PostgreSQLKeyword.IDENTITY, PostgreSQLKeyword.STATISTICS, PostgreSQLKeyword.PLAIN, PostgreSQLKeyword.EXTERNAL, PostgreSQLKeyword.EXTENDED, PostgreSQLKeyword.MAIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ protected TokenType[] getCustomizedAvailableKeywordsForSelectItemAlias() {
@Override
protected TokenType[] getCustomizedAvailableKeywordsForTableAlias() {
return new TokenType[] {
DefaultKeyword.DO, DefaultKeyword.TRUE, DefaultKeyword.FALSE, DefaultKeyword.COMMENT, DefaultKeyword.REPLACE, DefaultKeyword.BEFORE, DefaultKeyword.EACH, DefaultKeyword.ROW,
DefaultKeyword.TRUE, DefaultKeyword.FALSE, DefaultKeyword.COMMENT, DefaultKeyword.REPLACE, DefaultKeyword.BEFORE, DefaultKeyword.EACH, DefaultKeyword.ROW,
DefaultKeyword.FULLTEXT, DefaultKeyword.IDENTIFIED, DefaultKeyword.USING, DefaultKeyword.NATURAL, DefaultKeyword.CAST, DefaultKeyword.LOCK, DefaultKeyword.LEAVE,
DefaultKeyword.ITERATE, DefaultKeyword.REPEAT, DefaultKeyword.OUT, DefaultKeyword.INOUT, DefaultKeyword.LOOP, DefaultKeyword.EXPLAIN, DefaultKeyword.CHAR, DefaultKeyword.CHARACTER,
DefaultKeyword.VARCHAR, DefaultKeyword.VARCHAR2, DefaultKeyword.INTEGER, DefaultKeyword.INT, DefaultKeyword.SMALLINT, DefaultKeyword.DECIMAL, DefaultKeyword.DEC,
DefaultKeyword.NUMERIC, DefaultKeyword.FLOAT, DefaultKeyword.REAL, DefaultKeyword.PRECISION, DefaultKeyword.DATE, DefaultKeyword.INTERVAL, DefaultKeyword.BLOB,
DefaultKeyword.XOR, DefaultKeyword.BOTH, DefaultKeyword.LEADING, DefaultKeyword.TRAILING,
SQLServerKeyword.TIES, SQLServerKeyword.PARTITION, SQLServerKeyword.ONLY, SQLServerKeyword.OUTPUT, SQLServerKeyword.AUTO, SQLServerKeyword.TYPE, SQLServerKeyword.ELEMENTS,
SQLServerKeyword.TIES, SQLServerKeyword.ONLY, SQLServerKeyword.OUTPUT, SQLServerKeyword.AUTO, SQLServerKeyword.TYPE, SQLServerKeyword.ELEMENTS,
SQLServerKeyword.XML, SQLServerKeyword.XSINIL, SQLServerKeyword.XMLSCHEMA, SQLServerKeyword.TYP, SQLServerKeyword.APPLY, SQLServerKeyword.REDUCE, SQLServerKeyword.REPLICATE,
SQLServerKeyword.EXTRACT, SQLServerKeyword.REDISTRIBUTE,
};
Expand Down

0 comments on commit 978cbf2

Please sign in to comment.