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

Unrecognized keyword and Unrecognized alter operation

Open liviuconcioiu opened this issue 2 years ago • 3 comments

CHECK TABLE `table` FOR UPGRADE; will give two errors.

  1. Unrecognized keyword. (near FOR)
  2. Unrecognized keyword. (near UPGRADE)

ALTER TABLE `table` FORCE; will give one error.

  1. Unrecognized alter operation. (near ;)

https://user-images.githubusercontent.com/25424343/222978476-b5959513-be8d-4b49-af58-9b28121505f6.mp4

liviuconcioiu avatar Mar 05 '23 18:03 liviuconcioiu

I believe the two queries do execute, can you post a documentation link for this sort of query ?

williamdes avatar Mar 09 '23 19:03 williamdes

I believe the two queries do execute, can you post a documentation link for this sort of query ?

https://mariadb.com/kb/en/check-table/ https://mariadb.com/kb/en/alter-table/

https://dev.mysql.com/doc/refman/8.0/en/check-table.html https://dev.mysql.com/doc/refman/8.0/en/alter-table.html

liviuconcioiu avatar Mar 10 '23 00:03 liviuconcioiu

About the CHECK TABLE statement:

  • CHECK TABLE is available at least since MySQL 5.0: https://web.archive.org/web/20160324160726/https://dev.mysql.com/doc/refman/5.0/en/check-table.html
  • Keyword "FOR UPGRADE" is not part of the dictionnary.
  • I can't find any test in the parser for it, maybe we should add one

About the ALTER TABLE … FORCE statement:

  • Available since MySQL 5.5
    • NOT IN MySQL 5.1: https://web.archive.org/web/20160326052718/https://dev.mysql.com/doc/refman/5.1/en/alter-table.html
    • IN MySQL 5.5: https://web.archive.org/web/20160326034033/https://dev.mysql.com/doc/refman/5.5/en/alter-table.html
  • Keyword "FORCE" is not part of the TABLE_OPTIONS on AlterStatement class, so it is not managed yet.
  • Some tests in the parser must be added about it.

niconoe- avatar Aug 07 '24 09:08 niconoe-