Skip to content

Commit

Permalink
Alter table local option support
Browse files Browse the repository at this point in the history
  • Loading branch information
djklim87 committed May 9, 2024
1 parent 2e0901f commit 0f502ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/PHPSQLParser/processors/TableProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/parser/manticoreCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']

];
}
Expand Down

0 comments on commit 0f502ac

Please sign in to comment.