mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -1244,12 +1244,17 @@ public class SQLExprParser extends SQLParser {
|
||||
|
||||
public SQLName name() {
|
||||
String identName;
|
||||
long hash = 0;
|
||||
if (lexer.token == Token.LITERAL_ALIAS) {
|
||||
identName = lexer.stringVal();
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token == Token.IDENTIFIER) {
|
||||
identName = lexer.stringVal();
|
||||
|
||||
char c0 = identName.charAt(0);
|
||||
if (c0 != '[') {
|
||||
hash = lexer.hash_lower();
|
||||
}
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token == Token.LITERAL_CHARS) {
|
||||
identName = '\'' + lexer.stringVal() + '\'';
|
||||
@@ -1312,7 +1317,7 @@ public class SQLExprParser extends SQLParser {
|
||||
}
|
||||
}
|
||||
|
||||
SQLName name = new SQLIdentifierExpr(identName);
|
||||
SQLName name = new SQLIdentifierExpr(identName, hash);
|
||||
|
||||
name = nameRest(name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user