sql-parser icon indicating copy to clipboard operation
sql-parser copied to clipboard

'",": Unrecognized alter operation' when altering table with ALGORITHM and LOCK clauses

Open PierreKerschgens opened this issue 5 years ago • 1 comments

HI!

Despite I'm using your sql-parser as part of php-sqllint I think the following issue origins from sql-parser.

I have the following statement:

ALTER TABLE XXX DROP COLUMN YYY, ALGORITHM=INPLACE, LOCK=NONE;

Which results in the following false-positive:

Line 9, col 65 at ",": Unrecognized alter operation. Line 9, col 67 at "LOCK": A new statement was found, but no delimiter between it and the previous one. Line 9, col 67 at "LOCK": Unrecognized alter operation.

best regards!

PierreKerschgens avatar Nov 19 '20 11:11 PierreKerschgens

Hi @PierreKerschgens Thank you for the report !

williamdes avatar Nov 19 '20 14:11 williamdes

I added new tests in 6bdb41dbbf744203e38bcb3b0b6ac0048c543d2f Before I merge https://github.com/phpmyadmin/sql-parser/pull/440 to fix this issue

williamdes avatar Apr 14 '23 11:04 williamdes