mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved h2 parser
This commit is contained in:
@@ -3758,7 +3758,8 @@ public class SQLExprParser extends SQLParser {
|
||||
return unionType;
|
||||
}
|
||||
|
||||
if (lexer.identifierEquals(FnvHash.Constants.GENERATED)) {
|
||||
if (lexer.identifierEquals(FnvHash.Constants.GENERATED)
|
||||
|| lexer.identifierEquals(FnvHash.Constants.RENAME)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -4264,8 +4265,29 @@ public class SQLExprParser extends SQLParser {
|
||||
SQLExpr unitIndex = primary();
|
||||
column.setStep(unitIndex);
|
||||
}
|
||||
} else if (lexer.token == Token.LPAREN) {
|
||||
lexer.nextToken();
|
||||
SQLColumnDefinition.Identity ident = new SQLColumnDefinition.Identity();
|
||||
if (lexer.token == Token.LITERAL_INT) {
|
||||
ident.setSeed(lexer.integerValue().intValue());
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("TODO : " + lexer.info());
|
||||
}
|
||||
|
||||
if (lexer.token == Token.COMMA) {
|
||||
lexer.nextToken();
|
||||
if (lexer.token == Token.LITERAL_INT) {
|
||||
ident.setIncrement(lexer.integerValue().intValue());
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("TODO : " + lexer.info());
|
||||
}
|
||||
}
|
||||
|
||||
column.setIdentity(ident);
|
||||
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
return parseColumnRest(column);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user