mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql parser improved support db2 truncate syntax. for issue #1324
This commit is contained in:
@@ -1430,6 +1430,49 @@ public class SQLStatementParser extends SQLParser {
|
||||
stmt.setCascade(Boolean.FALSE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.DROP) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("STORAGE");
|
||||
stmt.setDropStorage(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("REUSE")) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("STORAGE");
|
||||
stmt.setReuseStorage(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("IGNORE")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.DELETE);
|
||||
acceptIdentifier("TRIGGERS");
|
||||
stmt.setIgnoreDeleteTriggers(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("RESTRICT")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.WHEN);
|
||||
accept(Token.DELETE);
|
||||
acceptIdentifier("TRIGGERS");
|
||||
stmt.setRestrictWhenDeleteTriggers(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.CONTINUE) {
|
||||
lexer.nextToken();
|
||||
accept(Token.IDENTITY);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identifierEquals("IMMEDIATE")) {
|
||||
lexer.nextToken();
|
||||
stmt.setImmediate(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user