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():
3462
3462
alterExp.setOperation(AlterOperation.DROP);
3463
3463
}
3464
3464
(
3465
- ( <K_COLUMN>
3465
+ ( (LOOKAHEAD(2) <K_COLUMN>)?
3466
3466
(tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER>)
3467
3467
{
3468
3468
alterExp.setColumnName(tk.image);
Original file line number Diff line number Diff line change @@ -244,4 +244,12 @@ public void testAlterTableAddColumnKeywordTypes() throws JSQLParserException {
244
244
public void testDropColumnRestrictIssue510 () throws JSQLParserException {
245
245
assertSqlCanBeParsedAndDeparsed ("ALTER TABLE TABLE1 DROP COLUMN NewColumn CASCADE" );
246
246
}
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
+ }
247
255
}
You can’t perform that action at this time.
0 commit comments