File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/alter Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3462,7 +3462,7 @@ AlterExpression AlterExpression():
34623462 alterExp.setOperation(AlterOperation.DROP);
34633463 }
34643464 (
3465- ( <K_COLUMN>
3465+ ( (LOOKAHEAD(2) <K_COLUMN>)?
34663466 (tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER>)
34673467 {
34683468 alterExp.setColumnName(tk.image);
Original file line number Diff line number Diff line change @@ -244,4 +244,12 @@ public void testAlterTableAddColumnKeywordTypes() throws JSQLParserException {
244244 public void testDropColumnRestrictIssue510 () throws JSQLParserException {
245245 assertSqlCanBeParsedAndDeparsed ("ALTER TABLE TABLE1 DROP COLUMN NewColumn CASCADE" );
246246 }
247+
248+ public void testDropColumnRestrictIssue551 () throws JSQLParserException {
249+ Statement stmt = CCJSqlParserUtil .parse ("ALTER TABLE table1 DROP NewColumn" );
250+
251+ // COLUMN keyword appears in deparsed statement, drop becomes all caps
252+ assertStatementCanBeDeparsedAs (stmt , "ALTER TABLE table1 DROP COLUMN NewColumn" );
253+
254+ }
247255}
You can’t perform that action at this time.
0 commit comments