Skip to content

Commit

Permalink
Merge pull request #575 from niconoe-/fix/5.10.x-missing-with-parser-…
Browse files Browse the repository at this point in the history
…token

Fix/5.10.x missing with parser token

- Fixes #563
- Closes #574
  • Loading branch information
MauricioFauth authored Aug 26, 2024
2 parents 6e7dafd + d166fd1 commit b6a1324
Show file tree
Hide file tree
Showing 21 changed files with 815 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql50100.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ class ContextMySql50100 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql50500.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ class ContextMySql50500 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql50600.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ class ContextMySql50600 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql50700.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ class ContextMySql50700 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql80000.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ class ContextMySql80000 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql80100.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ class ContextMySql80100 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql80200.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ class ContextMySql80200 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql80300.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ class ContextMySql80300 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/Contexts/ContextMySql80400.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ class ContextMySql80400 extends Context
'UNION ALL' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'UNION DISTINCT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH CONSISTENT SNAPSHOT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH PARSER' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'WITH ROLLUP' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_RESERVED | Token::FLAG_KEYWORD_COMPOSED,
'ARRAY' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
'BIT' => Token::FLAG_KEYWORD | Token::FLAG_KEYWORD_DATA_TYPE,
Expand Down
1 change: 1 addition & 0 deletions tests/Parser/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static function createProvider(): array
['parser/parseCreateTableEnforcedCheck'],
['parser/parseCreateTableNotEnforcedCheck'],
['parser/parseCreateTableWithInvisibleKey'],
['parser/parseCreateTableWithParser'],
['parser/parseCreateTrigger'],
['parser/parseCreateUser1'],
['parser/parseCreateUser2'],
Expand Down
5 changes: 5 additions & 0 deletions tests/data/parser/parseCreateTableWithParser.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE `mytable` (
`column_one` VARCHAR(255) DEFAULT NULL,
FULLTEXT KEY `fulltext_index` (`column_one`) /*!50100 WITH PARSER `ngram` */,
CONSTRAINT `my_constraint_1` FOREIGN KEY (`column_one`) REFERENCES `other_table` (`column_two`) ON DELETE RESTRICT ON UPDATE RESTRICT
)
Loading

0 comments on commit b6a1324

Please sign in to comment.