diff --git a/src/PHPSQLParser/processors/TableProcessor.php b/src/PHPSQLParser/processors/TableProcessor.php index 155edf2c..35baf6d4 100644 --- a/src/PHPSQLParser/processors/TableProcessor.php +++ b/src/PHPSQLParser/processors/TableProcessor.php @@ -235,8 +235,9 @@ public function process($tokens) case 'TYPE': case 'STATS_AUTO_RECALC': case 'STATS_PERSISTENT': + case 'LOCAL': case 'KEY_BLOCK_SIZE': - if ($prevCategory === 'CREATE_DEF') { + if (in_array($prevCategory, ['CREATE_DEF', 'TABLE_NAME']) ) { $expr[] = $this->getReservedType($trim); $currCategory = $prevCategory = 'TABLE_OPTION'; continue 2; diff --git a/tests/cases/parser/manticoreCasesTest.php b/tests/cases/parser/manticoreCasesTest.php index e06841a3..18e1e979 100644 --- a/tests/cases/parser/manticoreCasesTest.php +++ b/tests/cases/parser/manticoreCasesTest.php @@ -129,7 +129,8 @@ public function manticoreQueryProvider(): array ["ALTER MV view_name suspended=1", 'ms_alter_table_3'], // End aliases ["ALTER TABLE old_table RENAME new_table", 'ms_alter_table_4'], - ["ALTER TABLE `old_table` RENAME `new_table`", 'ms_alter_table_5'] + ["ALTER TABLE `old_table` RENAME `new_table`", 'ms_alter_table_5'], + ["alter table `dist` local='t1' local='t3'", 'ms_alter_table_6'] ]; }