diff --git a/src/PHPSQLParser/processors/TableProcessor.php b/src/PHPSQLParser/processors/TableProcessor.php index 35baf6d4..937df54f 100644 --- a/src/PHPSQLParser/processors/TableProcessor.php +++ b/src/PHPSQLParser/processors/TableProcessor.php @@ -236,6 +236,7 @@ public function process($tokens) case 'STATS_AUTO_RECALC': case 'STATS_PERSISTENT': case 'LOCAL': + case 'AGENT': case 'KEY_BLOCK_SIZE': if (in_array($prevCategory, ['CREATE_DEF', 'TABLE_NAME']) ) { $expr[] = $this->getReservedType($trim); diff --git a/tests/cases/parser/manticoreCasesTest.php b/tests/cases/parser/manticoreCasesTest.php index 18e1e979..2b6d4808 100644 --- a/tests/cases/parser/manticoreCasesTest.php +++ b/tests/cases/parser/manticoreCasesTest.php @@ -130,7 +130,7 @@ public function manticoreQueryProvider(): array // 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 `dist` local='t1' local='t3'", 'ms_alter_table_6'] + ["alter table `dist` local='t1' agent='127.0.0.1:9312:remote_index' local='t3'", 'ms_alter_table_6'] ]; } diff --git a/tests/expected/parser/ms_alter_table_6.serialized b/tests/expected/parser/ms_alter_table_6.serialized index ec4b6b2d..08954903 100644 --- a/tests/expected/parser/ms_alter_table_6.serialized +++ b/tests/expected/parser/ms_alter_table_6.serialized @@ -1 +1 @@ -a:2:{s:5:"ALTER";a:3:{s:9:"expr_type";s:5:"table";s:9:"base_expr";s:5:"table";s:8:"sub_tree";a:1:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"table";}}}s:5:"TABLE";a:5:{s:9:"base_expr";s:6:"`dist`";s:4:"name";s:6:"`dist`";s:9:"no_quotes";a:2:{s:5:"delim";b:0;s:5:"parts";a:1:{i:0;s:4:"dist";}}s:10:"create-def";b:0;s:7:"options";a:2:{i:0;a:4:{s:9:"expr_type";s:10:"expression";s:9:"base_expr";s:10:"local='t1'";s:5:"delim";s:1:" ";s:8:"sub_tree";a:3:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"local";}i:1;a:2:{s:9:"expr_type";s:8:"operator";s:9:"base_expr";s:1:"=";}i:2;a:2:{s:9:"expr_type";s:5:"const";s:9:"base_expr";s:4:"'t1'";}}}i:1;a:4:{s:9:"expr_type";s:10:"expression";s:9:"base_expr";s:10:"local='t3'";s:5:"delim";s:1:" ";s:8:"sub_tree";a:3:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"local";}i:1;a:2:{s:9:"expr_type";s:8:"operator";s:9:"base_expr";s:1:"=";}i:2;a:2:{s:9:"expr_type";s:5:"const";s:9:"base_expr";s:4:"'t3'";}}}}}} \ No newline at end of file +a:2:{s:5:"ALTER";a:3:{s:9:"expr_type";s:5:"table";s:9:"base_expr";s:5:"table";s:8:"sub_tree";a:1:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"table";}}}s:5:"TABLE";a:5:{s:9:"base_expr";s:6:"`dist`";s:4:"name";s:6:"`dist`";s:9:"no_quotes";a:2:{s:5:"delim";b:0;s:5:"parts";a:1:{i:0;s:4:"dist";}}s:10:"create-def";b:0;s:7:"options";a:3:{i:0;a:4:{s:9:"expr_type";s:10:"expression";s:9:"base_expr";s:10:"local='t1'";s:5:"delim";s:1:" ";s:8:"sub_tree";a:3:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"local";}i:1;a:2:{s:9:"expr_type";s:8:"operator";s:9:"base_expr";s:1:"=";}i:2;a:2:{s:9:"expr_type";s:5:"const";s:9:"base_expr";s:4:"'t1'";}}}i:1;a:4:{s:9:"expr_type";s:10:"expression";s:9:"base_expr";s:35:"agent='127.0.0.1:9312:remote_index'";s:5:"delim";s:1:" ";s:8:"sub_tree";a:3:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"agent";}i:1;a:2:{s:9:"expr_type";s:8:"operator";s:9:"base_expr";s:1:"=";}i:2;a:2:{s:9:"expr_type";s:5:"const";s:9:"base_expr";s:29:"'127.0.0.1:9312:remote_index'";}}}i:2;a:4:{s:9:"expr_type";s:10:"expression";s:9:"base_expr";s:10:"local='t3'";s:5:"delim";s:1:" ";s:8:"sub_tree";a:3:{i:0;a:2:{s:9:"expr_type";s:8:"reserved";s:9:"base_expr";s:5:"local";}i:1;a:2:{s:9:"expr_type";s:8:"operator";s:9:"base_expr";s:1:"=";}i:2;a:2:{s:9:"expr_type";s:5:"const";s:9:"base_expr";s:4:"'t3'";}}}}}} \ No newline at end of file