From 2b3e5b22ea7cdbdfe18d2d40e2e26ca72f05817b Mon Sep 17 00:00:00 2001 From: terrymanu Date: Tue, 16 Jan 2018 13:25:47 +0800 Subject: [PATCH] for #540 --- .../parsing/parser/clause/AliasClauseParser.java | 5 ++++- .../test/resources/integrate/assert/select.xml | 3 --- .../src/test/resources/parser/select.xml | 15 +++++++-------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/AliasClauseParser.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/AliasClauseParser.java index 4fb93951d8bb6..2f36718c21537 100644 --- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/AliasClauseParser.java +++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/parsing/parser/clause/AliasClauseParser.java @@ -33,7 +33,10 @@ public Optional parse() { return Optional.of(result); } if (lexerEngine.equalAny( - Literals.IDENTIFIER, Literals.CHARS, DefaultKeyword.USER, DefaultKeyword.END, DefaultKeyword.CASE, DefaultKeyword.KEY, DefaultKeyword.INTERVAL, DefaultKeyword.CONSTRAINT)) { + Literals.IDENTIFIER, Literals.CHARS, DefaultKeyword.TABLESPACE, DefaultKeyword.FUNCTION, DefaultKeyword.SEQUENCE, DefaultKeyword.OF, DefaultKeyword.DO, DefaultKeyword.NO, + DefaultKeyword.TEMPORARY, DefaultKeyword.TEMP, DefaultKeyword.COMMENT, DefaultKeyword.AFTER, DefaultKeyword.INSTEAD, DefaultKeyword.ROW, DefaultKeyword.STATEMENT, + DefaultKeyword.EXECUTE, DefaultKeyword.BITMAP, DefaultKeyword.NOSORT, DefaultKeyword.REVERSE, DefaultKeyword.COMPILE, DefaultKeyword.PASSWORD, + DefaultKeyword.USER, DefaultKeyword.END, DefaultKeyword.CASE, DefaultKeyword.KEY, DefaultKeyword.INTERVAL, DefaultKeyword.CONSTRAINT)) { String result = SQLUtil.getExactlyValue(lexerEngine.getCurrentToken().getLiterals()); lexerEngine.nextToken(); return Optional.of(result); diff --git a/sharding-jdbc-core/src/test/resources/integrate/assert/select.xml b/sharding-jdbc-core/src/test/resources/integrate/assert/select.xml index 345f2a410cb72..6c295821fcf91 100644 --- a/sharding-jdbc-core/src/test/resources/integrate/assert/select.xml +++ b/sharding-jdbc-core/src/test/resources/integrate/assert/select.xml @@ -166,12 +166,9 @@ - - diff --git a/sharding-jdbc-core/src/test/resources/parser/select.xml b/sharding-jdbc-core/src/test/resources/parser/select.xml index 648c161dc223a..160333e926646 100644 --- a/sharding-jdbc-core/src/test/resources/parser/select.xml +++ b/sharding-jdbc-core/src/test/resources/parser/select.xml @@ -325,18 +325,17 @@ - -