improved sql parser derby support, bug fixed for issue #3020

This commit is contained in:
shaojin.wensj
2019-01-30 21:12:20 +08:00
parent 212e8f0965
commit a9fa55033c
3 changed files with 20 additions and 2 deletions
@@ -17,6 +17,7 @@ package com.alibaba.druid.sql.parser;
import com.alibaba.druid.sql.ast.statement.SQLCreateTableStatement;
import com.alibaba.druid.sql.dialect.hive.stmt.HiveCreateTableStatement;
import com.alibaba.druid.util.FnvHash;
public class SQLParser {
protected final Lexer lexer;
@@ -79,8 +80,11 @@ public class SQLParser {
}
if (token == Token.IDENTIFIER) {
String ident = lexer.stringVal;
if (ident.equalsIgnoreCase("START") || ident.equalsIgnoreCase("CONNECT")) {
long hash = lexer.hash_lower;
if (hash == FnvHash.Constants.START
|| hash == FnvHash.Constants.CONNECT
|| hash == FnvHash.Constants.OFFSET
|| hash == FnvHash.Constants.LIMIT) {
if (must) {
throw new ParserException("illegal alias. " + lexer.info());
}