Skip to content

Commit 0f502ac

Browse files
author
djklim87
committed
Alter table local option support
1 parent 2e0901f commit 0f502ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/PHPSQLParser/processors/TableProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ public function process($tokens)
235235
case 'TYPE':
236236
case 'STATS_AUTO_RECALC':
237237
case 'STATS_PERSISTENT':
238+
case 'LOCAL':
238239
case 'KEY_BLOCK_SIZE':
239-
if ($prevCategory === 'CREATE_DEF') {
240+
if (in_array($prevCategory, ['CREATE_DEF', 'TABLE_NAME']) ) {
240241
$expr[] = $this->getReservedType($trim);
241242
$currCategory = $prevCategory = 'TABLE_OPTION';
242243
continue 2;

tests/cases/parser/manticoreCasesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public function manticoreQueryProvider(): array
129129
["ALTER MV view_name suspended=1", 'ms_alter_table_3'],
130130
// End aliases
131131
["ALTER TABLE old_table RENAME new_table", 'ms_alter_table_4'],
132-
["ALTER TABLE `old_table` RENAME `new_table`", 'ms_alter_table_5']
132+
["ALTER TABLE `old_table` RENAME `new_table`", 'ms_alter_table_5'],
133+
["alter table `dist` local='t1' local='t3'", 'ms_alter_table_6']
133134

134135
];
135136
}

0 commit comments

Comments
 (0)