diff --git a/composer.json b/composer.json index 4c1c3c48a..20387a97a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "phpstan/phpstan": "^0.12.87", "phpstan/phpstan-phpunit": "^0.12.16", "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "^7.4 || ^8 || ^9" + "phpunit/phpunit": "^7.4 || ^8 || ^9", + "zumba/json-serializer": "^3.0" }, "conflict": { "phpmyadmin/motranslator": "<3.0" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 097cda816..82cb0410a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2170,11 +2170,6 @@ parameters: count: 1 path: tests/TestCase.php - - - message: "#^Parameter \\#1 \\$variable_representation of function unserialize expects string, string\\|false given\\.$#" - count: 1 - path: tests/TestCase.php - - message: "#^Cannot access offset int on array\\\\|false\\.$#" count: 1 diff --git a/src/Tools/TestGenerator.php b/src/Tools/TestGenerator.php index 244606b51..921ebe9db 100644 --- a/src/Tools/TestGenerator.php +++ b/src/Tools/TestGenerator.php @@ -8,20 +8,26 @@ use PhpMyAdmin\SqlParser\Context; use PhpMyAdmin\SqlParser\Lexer; use PhpMyAdmin\SqlParser\Parser; +use Zumba\JsonSerializer\JsonSerializer; use function file_exists; use function file_get_contents; use function file_put_contents; use function in_array; use function is_dir; +use function json_decode; +use function json_encode; use function mkdir; use function print_r; use function scandir; -use function serialize; use function sprintf; use function strpos; use function substr; +use const JSON_PRESERVE_ZERO_FRACTION; +use const JSON_PRETTY_PRINT; +use const JSON_UNESCAPED_UNICODE; + /** * Used for test generation. */ @@ -148,9 +154,14 @@ public static function build($type, $input, $output, $debug = null, $ansi = fals // unset mode, reset to default every time, to be sure Context::setMode(); - + $serializer = new JsonSerializer(); // Writing test's data. - file_put_contents($output, serialize($test)); + $encoded = $serializer->serialize($test); + $encoded = json_encode( + json_decode($encoded), + JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION + ); + file_put_contents($output, $encoded); // Dumping test's data in human readable format too (if required). if (empty($debug)) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 95f299d84..e8b3a98c4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -14,10 +14,10 @@ use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\TokensList; use PHPUnit\Framework\TestCase as BaseTestCase; +use Zumba\JsonSerializer\JsonSerializer; use function file_get_contents; use function strpos; -use function unserialize; /** * Implements useful methods for testing. @@ -87,12 +87,8 @@ public function getErrorsAsArray($obj) */ public function getData($name) { - /* - * The unrestricted unserialize() is needed here as we do have - * serialized objects in the tests. There should be no security risk as - * the test data comes with the repository. - */ - $data = unserialize(file_get_contents('tests/data/' . $name . '.out')); + $serializer = new JsonSerializer(); + $data = $serializer->unserialize((string) file_get_contents('tests/data/' . $name . '.out')); $data['query'] = file_get_contents('tests/data/' . $name . '.in'); return $data; diff --git a/tests/data/bugs/gh14.out b/tests/data/bugs/gh14.out index 4549d6dce..a3b42732e 100644 --- a/tests/data/bugs/gh14.out +++ b/tests/data/bugs/gh14.out @@ -1,7 +1,927 @@ -a:4:{s:5:"query";s:113:"ALTER TABLE - `actor` MODIFY `actor_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT, - AUTO_INCREMENT = 201;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:113:"ALTER TABLE - `actor` MODIFY `actor_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT, - AUTO_INCREMENT = 201;";s:3:"len";i:113;s:4:"last";i:113;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`actor`";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:24;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"SMALLINT";s:5:"value";s:8:"SMALLINT";s:7:"keyword";s:8:"SMALLINT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:42;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:63;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:72;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:86;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:92;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:107;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:108;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"201";s:5:"value";i:201;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:109;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:112;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:29;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:7:"`actor`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:2:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:8:"actor_id";s:4:"expr";s:10:"`actor_id`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:10:{i:0;r:79;i:1;r:86;i:2;r:93;i:3;r:100;i:4;r:107;i:5;r:114;i:6;r:121;i:7;r:128;i:8;r:135;i:9;r:142;}}i:1;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:14:"AUTO_INCREMENT";s:6:"equals";b:1;s:4:"expr";s:3:"201";s:5:"value";s:3:"201";}}}s:5:"field";N;s:7:"unknown";a:0:{}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:27;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE\n `actor` MODIFY `actor_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,\n AUTO_INCREMENT = 201;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE\n `actor` MODIFY `actor_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,\n AUTO_INCREMENT = 201;", + "len": 113, + "last": 113, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor`", + "value": "actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SMALLINT", + "value": "SMALLINT", + "keyword": "SMALLINT", + "type": 1, + "flags": 11, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "201", + "value": 201, + "keyword": null, + "type": 6, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 29 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "`actor`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "actor_id", + "expr": "`actor_id`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "AUTO_INCREMENT", + "equals": true, + "expr": "201", + "value": "201" + } + } + }, + "field": null, + "unknown": [] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 27 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/gh16.out b/tests/data/bugs/gh16.out index 3b4aa6c43..31ba15f2c 100644 --- a/tests/data/bugs/gh16.out +++ b/tests/data/bugs/gh16.out @@ -1,31 +1,2823 @@ -a:4:{s:5:"query";s:476:"CREATE TABLE `jos_core_acl_aro` ( - `id` int(11) NOT NULL, - `section_value` varchar(240) NOT NULL DEFAULT '0', - `value` varchar(240) NOT NULL DEFAULT '', - `order_value` int(11) NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL DEFAULT '', - `hidden` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `jos_section_value_value_aro` (`section_value`(100),`value`(15)) USING BTREE, - KEY `jos_gacl_hidden_aro` (`hidden`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:476:"CREATE TABLE `jos_core_acl_aro` ( - `id` int(11) NOT NULL, - `section_value` varchar(240) NOT NULL DEFAULT '0', - `value` varchar(240) NOT NULL DEFAULT '', - `order_value` int(11) NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL DEFAULT '', - `hidden` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `jos_section_value_value_aro` (`section_value`(100),`value`(15)) USING BTREE, - KEY `jos_gacl_hidden_aro` (`hidden`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1";s:3:"len";i:476;s:4:"last";i:476;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:134:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`jos_core_acl_aro`";s:5:"value";s:16:"jos_core_acl_aro";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:36;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:41;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:44;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:45;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:49;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`section_value`";s:5:"value";s:13:"section_value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:61;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"varchar";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:77;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:84;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"240";s:5:"value";i:240;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:85;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:90;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:99;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'0'";s:5:"value";s:1:"0";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:107;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:110;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:114;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:121;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"varchar";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:122;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:129;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"240";s:5:"value";i:240;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:130;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:133;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:135;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:143;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:144;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:151;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"''";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:152;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:154;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:155;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`order_value`";s:5:"value";s:11:"order_value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:158;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:171;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:172;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:175;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:176;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:178;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:179;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:180;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:188;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:189;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:196;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'0'";s:5:"value";s:1:"0";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:197;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:200;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:201;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`name`";s:5:"value";s:4:"name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:204;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:210;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"varchar";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:211;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:218;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"255";s:5:"value";i:255;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:219;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:222;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:223;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:224;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:232;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:233;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:240;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"''";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:241;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:243;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:244;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`hidden`";s:5:"value";s:6:"hidden";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:247;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:255;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:256;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:259;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:260;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:262;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:263;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:264;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:272;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:273;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:280;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'0'";s:5:"value";s:1:"0";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:281;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:284;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:285;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:288;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:299;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:300;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:301;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:305;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:306;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:307;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"UNIQUE KEY";s:5:"value";s:10:"UNIQUE KEY";s:7:"keyword";s:10:"UNIQUE KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:310;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:320;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:29:"`jos_section_value_value_aro`";s:5:"value";s:27:"jos_section_value_value_aro";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:321;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:350;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:351;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`section_value`";s:5:"value";s:13:"section_value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:352;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:367;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"100";s:5:"value";i:100;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:368;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:371;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:372;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:373;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:380;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"15";s:5:"value";i:15;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:381;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:383;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:384;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:385;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:386;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:391;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BTREE";s:5:"value";s:5:"BTREE";s:7:"keyword";s:5:"BTREE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:392;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:397;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:398;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:401;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:404;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:21:"`jos_gacl_hidden_aro`";s:5:"value";s:19:"jos_gacl_hidden_aro";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:405;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:426;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:427;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`hidden`";s:5:"value";s:6:"hidden";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:428;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:436;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:437;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:438;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:439;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:440;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:446;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:447;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:453;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:454;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:469;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"latin1";s:5:"value";s:6:"latin1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:470;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:134;s:3:"idx";i:134;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:16:"jos_core_acl_aro";s:6:"column";N;s:4:"expr";s:18:"`jos_core_acl_aro`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}i:4;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:6:"latin1";s:5:"value";s:6:"latin1";}}}s:6:"fields";a:9:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:13:"section_value";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:3:"240";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"0";s:4:"expr";s:3:"'0'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"'0'";}}}}i:2;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:5:"value";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:3:"240";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:0:"";s:4:"expr";s:2:"''";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:2:"''";}}}}i:3;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:11:"order_value";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"0";s:4:"expr";s:3:"'0'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"'0'";}}}}i:4;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:4:"name";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:3:"255";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:0:"";s:4:"expr";s:2:"''";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:2:"''";}}}}i:5;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:6:"hidden";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"0";s:4:"expr";s:3:"'0'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"'0'";}}}}i:6;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:2:"id";}}s:4:"type";s:11:"PRIMARY KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:7;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";s:27:"jos_section_value_value_aro";s:7:"columns";a:2:{i:0;a:2:{s:4:"name";s:13:"section_value";s:6:"length";i:100;}i:1;a:2:{s:4:"name";s:5:"value";s:6:"length";i:15;}}s:4:"type";s:10:"UNIQUE KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:5:"USING";s:6:"equals";b:0;s:4:"expr";s:5:"BTREE";s:5:"value";s:5:"BTREE";}}}}s:10:"references";N;s:7:"options";N;}i:8;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";s:19:"jos_gacl_hidden_aro";s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:6:"hidden";}}s:4:"type";s:3:"KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:133;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `jos_core_acl_aro` (\n `id` int(11) NOT NULL,\n `section_value` varchar(240) NOT NULL DEFAULT '0',\n `value` varchar(240) NOT NULL DEFAULT '',\n `order_value` int(11) NOT NULL DEFAULT '0',\n `name` varchar(255) NOT NULL DEFAULT '',\n `hidden` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `jos_section_value_value_aro` (`section_value`(100),`value`(15)) USING BTREE,\n KEY `jos_gacl_hidden_aro` (`hidden`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `jos_core_acl_aro` (\n `id` int(11) NOT NULL,\n `section_value` varchar(240) NOT NULL DEFAULT '0',\n `value` varchar(240) NOT NULL DEFAULT '',\n `order_value` int(11) NOT NULL DEFAULT '0',\n `name` varchar(255) NOT NULL DEFAULT '',\n `hidden` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `jos_section_value_value_aro` (`section_value`(100),`value`(15)) USING BTREE,\n KEY `jos_gacl_hidden_aro` (`hidden`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1", + "len": 476, + "last": 476, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`jos_core_acl_aro`", + "value": "jos_core_acl_aro", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`section_value`", + "value": "section_value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "varchar", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "240", + "value": 240, + "keyword": null, + "type": 6, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'0'", + "value": "0", + "keyword": null, + "type": 7, + "flags": 1, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "varchar", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "240", + "value": 240, + "keyword": null, + "type": 6, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "''", + "value": "", + "keyword": null, + "type": 7, + "flags": 1, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`order_value`", + "value": "order_value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'0'", + "value": "0", + "keyword": null, + "type": 7, + "flags": 1, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 200 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`name`", + "value": "name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 204 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "varchar", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "255", + "value": 255, + "keyword": null, + "type": 6, + "flags": 0, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 223 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 224 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 233 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 240 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "''", + "value": "", + "keyword": null, + "type": 7, + "flags": 1, + "position": 241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 243 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`hidden`", + "value": "hidden", + "keyword": null, + "type": 8, + "flags": 2, + "position": 247 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 255 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 256 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 259 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 260 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 262 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 263 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 264 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 272 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 273 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 280 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'0'", + "value": "0", + "keyword": null, + "type": 7, + "flags": 1, + "position": 281 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 284 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 285 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 288 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 299 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 300 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 301 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 305 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 306 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 307 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNIQUE KEY", + "value": "UNIQUE KEY", + "keyword": "UNIQUE KEY", + "type": 1, + "flags": 23, + "position": 310 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 320 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`jos_section_value_value_aro`", + "value": "jos_section_value_value_aro", + "keyword": null, + "type": 8, + "flags": 2, + "position": 321 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 350 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 351 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`section_value`", + "value": "section_value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 352 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 367 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "100", + "value": 100, + "keyword": null, + "type": 6, + "flags": 0, + "position": 368 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 371 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 372 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 373 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 380 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "15", + "value": 15, + "keyword": null, + "type": 6, + "flags": 0, + "position": 381 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 383 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 384 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 385 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 386 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 391 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BTREE", + "value": "BTREE", + "keyword": "BTREE", + "type": 1, + "flags": 1, + "position": 392 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 397 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 398 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 401 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 404 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`jos_gacl_hidden_aro`", + "value": "jos_gacl_hidden_aro", + "keyword": null, + "type": 8, + "flags": 2, + "position": 405 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 426 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 427 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`hidden`", + "value": "hidden", + "keyword": null, + "type": 8, + "flags": 2, + "position": 428 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 436 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 437 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 438 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 439 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 440 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 446 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 447 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 453 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 454 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 469 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "latin1", + "value": "latin1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 470 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 134, + "idx": 134 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "jos_core_acl_aro", + "column": null, + "expr": "`jos_core_acl_aro`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + }, + "4": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "latin1", + "value": "latin1" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "section_value", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "240" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "0", + "expr": "'0'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'0'" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "value", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "240" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "", + "expr": "''", + "alias": null, + "function": null, + "subquery": null + }, + "value": "''" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "order_value", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "0", + "expr": "'0'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'0'" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "name", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "255" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "", + "expr": "''", + "alias": null, + "function": null, + "subquery": null + }, + "value": "''" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "hidden", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "0", + "expr": "'0'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'0'" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "id" + } + ], + "type": "PRIMARY KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": "jos_section_value_value_aro", + "columns": [ + { + "name": "section_value", + "length": 100 + }, + { + "name": "value", + "length": 15 + } + ], + "type": "UNIQUE KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "USING", + "equals": false, + "expr": "BTREE", + "value": "BTREE" + } + } + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": "jos_gacl_hidden_aro", + "columns": [ + { + "name": "hidden" + } + ], + "type": "KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 133 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/gh317.out b/tests/data/bugs/gh317.out index 1df2e198f..bf5338d4e 100644 --- a/tests/data/bugs/gh317.out +++ b/tests/data/bugs/gh317.out @@ -1 +1,688 @@ -a:4:{s:5:"query";s:51:"ALTER TABLE `demo` ADD KEY `IDX_REPAIR` (`REPAIR`);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:51:"ALTER TABLE `demo` ADD KEY `IDX_REPAIR` (`REPAIR`);";s:3:"len";i:51;s:4:"last";i:51;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`demo`";s:5:"value";s:4:"demo";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ADD";s:5:"value";s:3:"ADD";s:7:"keyword";s:3:"ADD";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`IDX_REPAIR`";s:5:"value";s:10:"IDX_REPAIR";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`REPAIR`";s:5:"value";s:6:"REPAIR";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:41;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"demo";s:6:"column";N;s:4:"expr";s:6:"`demo`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:3:"ADD";i:2;s:3:"KEY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:10:"IDX_REPAIR";s:4:"expr";s:12:"`IDX_REPAIR`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:3:{i:0;r:93;i:1;r:100;i:2;r:107;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE `demo` ADD KEY `IDX_REPAIR` (`REPAIR`);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `demo` ADD KEY `IDX_REPAIR` (`REPAIR`);", + "len": 51, + "last": 51, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`demo`", + "value": "demo", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ADD", + "value": "ADD", + "keyword": "ADD", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`IDX_REPAIR`", + "value": "IDX_REPAIR", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`REPAIR`", + "value": "REPAIR", + "keyword": null, + "type": 8, + "flags": 2, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "demo", + "column": null, + "expr": "`demo`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ADD", + "2": "KEY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "IDX_REPAIR", + "expr": "`IDX_REPAIR`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/gh9.out b/tests/data/bugs/gh9.out index fea90a5dc..976efe290 100644 --- a/tests/data/bugs/gh9.out +++ b/tests/data/bugs/gh9.out @@ -1,34 +1,1882 @@ -a:4:{s:5:"query";s:213:"SELECT * FROM foo WHERE -SELECT * FROM foo WHERE - -START TRANSACTION; - -CREATE TABLE `tb` (`uid` INT UNSIGNED NOT NULL -`position` INT NOT NULL, -PRIMARY KEY ( `uid` ) , -INDEX ( `position` ) -) ENGINE = InnoDB; - -COMMIT;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:213:"SELECT * FROM foo WHERE -SELECT * FROM foo WHERE - -START TRANSACTION; - -CREATE TABLE `tb` (`uid` INT UNSIGNED NOT NULL -`position` INT NOT NULL, -PRIMARY KEY ( `uid` ) , -INDEX ( `position` ) -) ENGINE = InnoDB; - -COMMIT;";s:3:"len";i:213;s:4:"last";i:213;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:75:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:38;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"START TRANSACTION";s:5:"value";s:17:"START TRANSACTION";s:7:"keyword";s:17:"START TRANSACTION";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:66;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:69;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`tb`";s:5:"value";s:2:"tb";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:94;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:98;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:107;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:115;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`position`";s:5:"value";s:8:"position";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:116;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:127;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:131;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:139;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:140;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:141;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:152;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:153;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:155;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:161;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:162;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:163;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:164;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"INDEX";s:5:"value";s:5:"INDEX";s:7:"keyword";s:5:"INDEX";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:165;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:170;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:171;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:172;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`position`";s:5:"value";s:8:"position";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:173;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:183;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:184;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:185;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:186;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:187;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:188;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:194;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:195;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:196;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:197;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:203;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:204;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"COMMIT";s:5:"value";s:6:"COMMIT";s:7:"keyword";s:6:"COMMIT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:206;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:212;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:75;s:3:"idx";i:75;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:3:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:0:{}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:9;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:0:{}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:10;s:4:"last";i:19;}i:2;O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:1;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"tb";s:6:"column";N;s:4:"expr";s:4:"`tb`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:3:"uid";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:4;s:8:"UNSIGNED";}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:21;s:4:"last";i:47;}}s:3:"end";O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:2;s:10:"statements";N;s:3:"end";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"COMMIT";}}s:5:"first";i:72;s:4:"last";i:72;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:17:"START TRANSACTION";}}s:5:"first";i:20;s:4:"last";i:20;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:5:{i:0;a:3:{i:0;s:42:"This type of clause was previously parsed.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:149;i:2;i:0;}i:2;a:3:{i:0;s:42:"A comma or a closing bracket was expected.";i:1;r:275;i:2;i:0;}i:3;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:352;i:2;i:0;}i:4;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:394;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM foo WHERE\nSELECT * FROM foo WHERE\n\nSTART TRANSACTION;\n\nCREATE TABLE `tb` (`uid` INT UNSIGNED NOT NULL\n`position` INT NOT NULL,\nPRIMARY KEY ( `uid` ) ,\nINDEX ( `position` )\n) ENGINE = InnoDB;\n\nCOMMIT;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM foo WHERE\nSELECT * FROM foo WHERE\n\nSTART TRANSACTION;\n\nCREATE TABLE `tb` (`uid` INT UNSIGNED NOT NULL\n`position` INT NOT NULL,\nPRIMARY KEY ( `uid` ) ,\nINDEX ( `position` )\n) ENGINE = InnoDB;\n\nCOMMIT;", + "len": 213, + "last": 213, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "START TRANSACTION", + "value": "START TRANSACTION", + "keyword": "START TRANSACTION", + "type": 1, + "flags": 7, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tb`", + "value": "tb", + "keyword": null, + "type": 8, + "flags": 2, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`position`", + "value": "position", + "keyword": null, + "type": 8, + "flags": 2, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INDEX", + "value": "INDEX", + "keyword": "INDEX", + "type": 1, + "flags": 19, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`position`", + "value": "position", + "keyword": null, + "type": 8, + "flags": 2, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 184 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 185 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 186 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 194 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 203 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 204 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COMMIT", + "value": "COMMIT", + "keyword": "COMMIT", + "type": 1, + "flags": 1, + "position": 206 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 75, + "idx": 75 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 10, + "last": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 1, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tb", + "column": null, + "expr": "`tb`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "uid", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "4": "UNSIGNED" + } + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 21, + "last": 47 + } + ], + "end": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 2, + "statements": null, + "end": null, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "COMMIT" + } + }, + "first": 72, + "last": 72 + }, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "START TRANSACTION" + } + }, + "first": 20, + "last": 20 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This type of clause was previously parsed.", + { + "@type": "@12" + }, + 0 + ], + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@22" + }, + 0 + ], + [ + "A comma or a closing bracket was expected.", + { + "@type": "@40" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@51" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@57" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/bugs/pma11800.out b/tests/data/bugs/pma11800.out index 391364acc..acd2d210a 100644 --- a/tests/data/bugs/pma11800.out +++ b/tests/data/bugs/pma11800.out @@ -1 +1,620 @@ -a:4:{s:5:"query";s:27:"SELECT 'a' REGEXP '^[a-d]';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:27:"SELECT 'a' REGEXP '^[a-d]';";s:3:"len";i:27;s:4:"last";i:27;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'a'";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"REGEXP";s:5:"value";s:6:"REGEXP";s:7:"keyword";s:6:"REGEXP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'^[a-d]'";s:5:"value";s:6:"^[a-d]";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:26;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:18:"'a'REGEXP '^[a-d]'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 'a' REGEXP '^[a-d]';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 'a' REGEXP '^[a-d]';", + "len": 27, + "last": 27, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'a'", + "value": "a", + "keyword": null, + "type": 7, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REGEXP", + "value": "REGEXP", + "keyword": "REGEXP", + "type": 1, + "flags": 3, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'^[a-d]'", + "value": "^[a-d]", + "keyword": null, + "type": 7, + "flags": 1, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "'a'REGEXP '^[a-d]'", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 6 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/pma11836.out b/tests/data/bugs/pma11836.out index 039a6a346..6dbe3b565 100644 --- a/tests/data/bugs/pma11836.out +++ b/tests/data/bugs/pma11836.out @@ -1 +1,1074 @@ -a:4:{s:5:"query";s:94:"SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:94:"SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)";s:3:"len";i:94;s:4:"last";i:94;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:45:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"alumnos";s:5:"value";s:7:"alumnos";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:7:"keyword";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:33;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:39;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"nombre";s:5:"value";s:6:"nombre";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:60;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"not in";s:5:"value";s:6:"NOT IN";s:7:"keyword";s:6:"NOT IN";s:4:"type";i:1;s:5:"flags";i:39;s:8:"position";i:63;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"alumnos";s:5:"value";s:7:"alumnos";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:93;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:45;s:3:"idx";i:45;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"alumnos";s:6:"column";N;s:4:"expr";s:7:"alumnos";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:3:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:2:"id";i:1;s:6:"nombre";}s:10:"isOperator";b:0;s:4:"expr";s:27:"id = IF(id = 1, id, nombre)";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:2:"id";i:1;s:7:"alumnos";}s:10:"isOperator";b:0;s:4:"expr";s:34:"id not in (SELECT id FROM alumnos)";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:43;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM alumnos WHERE id = IF(id = 1, id, nombre) AND id not in (SELECT id FROM alumnos)", + "len": 94, + "last": 94, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "alumnos", + "value": "alumnos", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF", + "value": "IF", + "keyword": "IF", + "type": 1, + "flags": 35, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nombre", + "value": "nombre", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "not in", + "value": "NOT IN", + "keyword": "NOT IN", + "type": 1, + "flags": 39, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "alumnos", + "value": "alumnos", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 45, + "idx": 45 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "alumnos", + "column": null, + "expr": "alumnos", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "id", + "nombre" + ], + "isOperator": false, + "expr": "id = IF(id = 1, id, nombre)" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "id", + "alumnos" + ], + "isOperator": false, + "expr": "id not in (SELECT id FROM alumnos)" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 43 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/pma11843.out b/tests/data/bugs/pma11843.out index 2f1960b01..b495ce978 100644 --- a/tests/data/bugs/pma11843.out +++ b/tests/data/bugs/pma11843.out @@ -1,10 +1,1110 @@ -a:4:{s:5:"query";s:119:"CREATE TABLE `mytable` ( - `id` int(11) NOT NULL, - `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP -);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:119:"CREATE TABLE `mytable` ( - `id` int(11) NOT NULL, - `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP -);";s:3:"len";i:119;s:4:"last";i:119;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`mytable`";s:5:"value";s:7:"mytable";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:29;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:37;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`created_at`";s:5:"value";s:10:"created_at";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:56;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"timestamp";s:5:"value";s:9:"timestamp";s:7:"keyword";s:9:"TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:69;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"6";s:5:"value";i:6;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:79;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:82;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:91;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"CURRENT_TIMESTAMP";s:5:"value";s:17:"CURRENT_TIMESTAMP";s:7:"keyword";s:17:"CURRENT_TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:99;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:116;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:117;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:118;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"mytable";s:6:"column";N;s:4:"expr";s:9:"`mytable`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:2:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:10:"created_at";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:9:"TIMESTAMP";s:10:"parameters";a:1:{i:0;s:1:"6";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:17:"CURRENT_TIMESTAMP";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:17:"CURRENT_TIMESTAMP";}}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `mytable` (\n `id` int(11) NOT NULL,\n `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP\n);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `mytable` (\n `id` int(11) NOT NULL,\n `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP\n);", + "len": 119, + "last": 119, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mytable`", + "value": "mytable", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`created_at`", + "value": "created_at", + "keyword": null, + "type": 8, + "flags": 2, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "timestamp", + "value": "timestamp", + "keyword": "TIMESTAMP", + "type": 1, + "flags": 41, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "6", + "value": 6, + "keyword": null, + "type": 6, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CURRENT_TIMESTAMP", + "value": "CURRENT_TIMESTAMP", + "keyword": "CURRENT_TIMESTAMP", + "type": 1, + "flags": 35, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 34 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "mytable", + "column": null, + "expr": "`mytable`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "created_at", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "TIMESTAMP", + "parameters": [ + "6" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "CURRENT_TIMESTAMP", + "alias": null, + "function": null, + "subquery": null + }, + "value": "CURRENT_TIMESTAMP" + } + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/pma11867.out b/tests/data/bugs/pma11867.out index ec3baa992..8eb940cfb 100644 --- a/tests/data/bugs/pma11867.out +++ b/tests/data/bugs/pma11867.out @@ -1 +1,410 @@ -a:4:{s:5:"query";s:15:"DESC tablename;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:15:"DESC tablename;";s:3:"len";i:15;s:4:"last";i:15;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DESC";s:5:"value";s:4:"DESC";s:7:"keyword";s:4:"DESC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ExplainStatement":4:{s:7:"unknown";a:3:{i:0;r:9;i:1;r:16;i:2;r:23;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DESC tablename;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DESC tablename;", + "len": 15, + "last": 15, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DESC", + "value": "DESC", + "keyword": "DESC", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tablename", + "value": "tablename", + "keyword": null, + "type": 0, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "unknown": [ + { + "@type": "@2" + }, + { + "@type": "@3" + }, + { + "@type": "@4" + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/bugs/pma11879.out b/tests/data/bugs/pma11879.out index f959e92a3..8fd95d17b 100644 --- a/tests/data/bugs/pma11879.out +++ b/tests/data/bugs/pma11879.out @@ -1,10 +1,939 @@ -a:4:{s:5:"query";s:175:"INSERT INTO - tbproject(`id`, `name`, `description`, `create_dt`, `dbtype`, `useclause`, `sync_comments`) -VALUES - (NULL, 'testdb', 'Descrizione test', NOW(), 'mySQL', '', 1);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:175:"INSERT INTO - tbproject(`id`, `name`, `description`, `create_dt`, `dbtype`, `useclause`, `sync_comments`) -VALUES - (NULL, 'testdb', 'Descrizione test', NOW(), 'mySQL', '', 1);";s:3:"len";i:175;s:4:"last";i:175;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:54:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tbproject";s:5:"value";s:9:"tbproject";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:24;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`name`";s:5:"value";s:4:"name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`description`";s:5:"value";s:11:"description";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:51;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`create_dt`";s:5:"value";s:9:"create_dt";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:53;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`dbtype`";s:5:"value";s:6:"dbtype";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:66;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:74;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`useclause`";s:5:"value";s:9:"useclause";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:76;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:87;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`sync_comments`";s:5:"value";s:13:"sync_comments";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:89;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:104;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:105;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:106;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:115;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:116;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:120;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:121;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'testdb'";s:5:"value";s:6:"testdb";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:122;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:130;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"'Descrizione test'";s:5:"value";s:16:"Descrizione test";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:132;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:150;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:151;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"NOW";s:5:"value";s:3:"NOW";s:7:"keyword";s:3:"NOW";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:152;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:155;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:156;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:157;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"'mySQL'";s:5:"value";s:5:"mySQL";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:159;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:166;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:167;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"''";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:168;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:170;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:171;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:172;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:173;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:174;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:54;s:3:"idx";i:54;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tbproject";s:6:"column";N;s:4:"expr";s:9:"tbproject";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:7:{i:0;s:2:"id";i:1;s:4:"name";i:2;s:11:"description";i:3;s:9:"create_dt";i:4;s:6:"dbtype";i:5;s:9:"useclause";i:6;s:13:"sync_comments";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:1:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:7:{i:0;s:4:"NULL";i:1;s:8:"'testdb'";i:2;s:18:"'Descrizione test'";i:3;s:5:"NOW()";i:4;s:7:"'mySQL'";i:5;s:2:"''";i:6;s:1:"1";}s:6:"values";a:7:{i:0;s:4:"NULL";i:1;s:6:"testdb";i:2;s:16:"Descrizione test";i:3;s:5:"NOW()";i:4;s:5:"mySQL";i:5;s:0:"";i:6;s:1:"1";}}}s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:51;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO\n tbproject(`id`, `name`, `description`, `create_dt`, `dbtype`, `useclause`, `sync_comments`)\nVALUES\n (NULL, 'testdb', 'Descrizione test', NOW(), 'mySQL', '', 1);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO\n tbproject(`id`, `name`, `description`, `create_dt`, `dbtype`, `useclause`, `sync_comments`)\nVALUES\n (NULL, 'testdb', 'Descrizione test', NOW(), 'mySQL', '', 1);", + "len": 175, + "last": 175, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbproject", + "value": "tbproject", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`name`", + "value": "name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`description`", + "value": "description", + "keyword": null, + "type": 8, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`create_dt`", + "value": "create_dt", + "keyword": null, + "type": 8, + "flags": 2, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`dbtype`", + "value": "dbtype", + "keyword": null, + "type": 8, + "flags": 2, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`useclause`", + "value": "useclause", + "keyword": null, + "type": 8, + "flags": 2, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sync_comments`", + "value": "sync_comments", + "keyword": null, + "type": 8, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'testdb'", + "value": "testdb", + "keyword": null, + "type": 7, + "flags": 1, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Descrizione test'", + "value": "Descrizione test", + "keyword": null, + "type": 7, + "flags": 1, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOW", + "value": "NOW", + "keyword": "NOW", + "type": 1, + "flags": 33, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'mySQL'", + "value": "mySQL", + "keyword": null, + "type": 7, + "flags": 1, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "''", + "value": "", + "keyword": null, + "type": 7, + "flags": 1, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 54, + "idx": 54 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbproject", + "column": null, + "expr": "tbproject", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "name", + "description", + "create_dt", + "dbtype", + "useclause", + "sync_comments" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "NULL", + "'testdb'", + "'Descrizione test'", + "NOW()", + "'mySQL'", + "''", + "1" + ], + "values": [ + "NULL", + "testdb", + "Descrizione test", + "NOW()", + "mySQL", + "", + "1" + ] + } + ], + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 51 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lex.out b/tests/data/lexer/lex.out index 634ebbb76..866c6223c 100644 --- a/tests/data/lexer/lex.out +++ b/tests/data/lexer/lex.out @@ -1 +1,97 @@ -a:4:{s:5:"query";s:9:"SELECT \\";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:9:"SELECT \\";s:3:"len";i:9;s:4:"last";i:9;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"\";s:5:"value";s:1:"\";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"\";s:5:"value";s:1:"\";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:2:{i:0;a:4:{i:0;s:21:"Unexpected character.";i:1;s:1:"\";i:2;i:7;i:3;i:0;}i:1;a:4:{i:0;s:21:"Unexpected character.";i:1;s:1:"\";i:2;i:8;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT \\\\", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT \\\\", + "len": 9, + "last": 9, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\\", + "value": "\\", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\\", + "value": "\\", + "keyword": null, + "type": 0, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Unexpected character.", + "\\", + 7, + 0 + ], + [ + "Unexpected character.", + "\\", + 8, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexBool.out b/tests/data/lexer/lexBool.out index c801c7a4d..bfda4cfc7 100644 --- a/tests/data/lexer/lexBool.out +++ b/tests/data/lexer/lexBool.out @@ -1 +1,102 @@ -a:4:{s:5:"query";s:18:"SELECT true, FalSe";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"SELECT true, FalSe";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:7:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"true";s:5:"value";b:1;s:7:"keyword";N;s:4:"type";i:5;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FalSe";s:5:"value";b:0;s:7:"keyword";N;s:4:"type";i:5;s:5:"flags";i:1;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:7;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT true, FalSe", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT true, FalSe", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "true", + "value": true, + "keyword": null, + "type": 5, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FalSe", + "value": false, + "keyword": null, + "type": 5, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 7, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexComment.out b/tests/data/lexer/lexComment.out index c3b81e84a..db6c07167 100644 --- a/tests/data/lexer/lexComment.out +++ b/tests/data/lexer/lexComment.out @@ -1,10 +1,264 @@ -a:4:{s:5:"query";s:110:"# comment -SELECT /*!50000 STRAIGHT_JOIN */ col1 FROM table1, table2 /* select query */ --- comment --- comment 2";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:110:"# comment -SELECT /*!50000 STRAIGHT_JOIN */ col1 FROM table1, table2 /* select query */ --- comment --- comment 2";s:3:"len";i:110;s:4:"last";i:111;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:25:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"# comment";s:5:"value";s:9:"# comment";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:1;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"/*!50000";s:5:"value";s:8:"/*!50000";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:10;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"STRAIGHT_JOIN";s:5:"value";s:13:"STRAIGHT_JOIN";s:7:"keyword";s:13:"STRAIGHT_JOIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"*/";s:5:"value";s:2:"*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"col1";s:5:"value";s:4:"col1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:43;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:59;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"/* select query */";s:5:"value";s:18:"/* select query */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:68;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"-- comment";s:5:"value";s:10:"-- comment";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:87;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"-- comment 2";s:5:"value";s:12:"-- comment 2";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:98;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:25;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "# comment\nSELECT \/*!50000 STRAIGHT_JOIN *\/ col1 FROM table1, table2 \/* select query *\/\n-- comment\n-- comment 2", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "# comment\nSELECT \/*!50000 STRAIGHT_JOIN *\/ col1 FROM table1, table2 \/* select query *\/\n-- comment\n-- comment 2", + "len": 110, + "last": 111, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "# comment", + "value": "# comment", + "keyword": null, + "type": 4, + "flags": 1, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*!50000", + "value": "\/*!50000", + "keyword": null, + "type": 4, + "flags": 10, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "STRAIGHT_JOIN", + "value": "STRAIGHT_JOIN", + "keyword": "STRAIGHT_JOIN", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*\/", + "value": "*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "col1", + "value": "col1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* select query *\/", + "value": "\/* select query *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- comment", + "value": "-- comment", + "keyword": null, + "type": 4, + "flags": 4, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- comment 2", + "value": "-- comment 2", + "keyword": null, + "type": 4, + "flags": 4, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 25, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexCommentEnd.out b/tests/data/lexer/lexCommentEnd.out index 35a012cd8..1ec219d5c 100644 --- a/tests/data/lexer/lexCommentEnd.out +++ b/tests/data/lexer/lexCommentEnd.out @@ -1,7 +1,111 @@ -a:4:{s:5:"query";s:22:"SELECT 1 --- comment ---";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:22:"SELECT 1 --- comment ---";s:3:"len";i:22;s:4:"last";i:23;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"-- comment";s:5:"value";s:10:"-- comment";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"--";s:5:"value";s:2:"--";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 1\n-- comment\n--", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 1\n-- comment\n--", + "len": 22, + "last": 23, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- comment", + "value": "-- comment", + "keyword": null, + "type": 4, + "flags": 4, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "--", + "value": "--", + "keyword": null, + "type": 4, + "flags": 4, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiter.out b/tests/data/lexer/lexDelimiter.out index 85464956f..1cb443c8f 100644 --- a/tests/data/lexer/lexDelimiter.out +++ b/tests/data/lexer/lexDelimiter.out @@ -1,7 +1,255 @@ -a:4:{s:5:"query";s:53:"DELIMITER GO -SELECT a,b FROM foo GO -SELECT * FROM bar";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:53:"DELIMITER GO -SELECT a,b FROM foo GO -SELECT * FROM bar";s:3:"len";i:53;s:4:"last";i:53;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"GO";s:5:"value";s:2:"GO";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"GO";s:5:"value";s:2:"GO";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:33;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:36;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:0;}s:9:"delimiter";s:2:"GO";s:12:"delimiterLen";i:2;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER GO\nSELECT a,b FROM foo GO\nSELECT * FROM bar", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER GO\nSELECT a,b FROM foo GO\nSELECT * FROM bar", + "len": 53, + "last": 53, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "GO", + "value": "GO", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "GO", + "value": "GO", + "keyword": null, + "type": 9, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": "GO", + "delimiterLen": 2, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiter2.out b/tests/data/lexer/lexDelimiter2.out index 91128038f..c8020d7a9 100644 --- a/tests/data/lexer/lexDelimiter2.out +++ b/tests/data/lexer/lexDelimiter2.out @@ -1,7 +1,300 @@ -a:4:{s:5:"query";s:56:"DELIMTER // -SELECT a,b FROM test // -SELECT * FROM bar //";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:56:"DELIMTER // -SELECT a,b FROM test // -SELECT * FROM bar //";s:3:"len";i:56;s:4:"last";i:56;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DELIMTER";s:5:"value";s:8:"DELIMTER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:9;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:33;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:34;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:36;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:54;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"/";s:5:"value";s:1:"/";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:55;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMTER \/\/\nSELECT a,b FROM test \/\/\nSELECT * FROM bar \/\/", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMTER \/\/\nSELECT a,b FROM test \/\/\nSELECT * FROM bar \/\/", + "len": 56, + "last": 56, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMTER", + "value": "DELIMTER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/", + "value": "\/", + "keyword": null, + "type": 2, + "flags": 1, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiterErr1.out b/tests/data/lexer/lexDelimiterErr1.out index b4a83fa84..97a9e78ec 100644 --- a/tests/data/lexer/lexDelimiterErr1.out +++ b/tests/data/lexer/lexDelimiterErr1.out @@ -1 +1,64 @@ -a:4:{s:5:"query";s:9:"DELIMITER";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:9:"DELIMITER";s:3:"len";i:9;s:4:"last";i:9;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:2:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:2;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:40:"Expected whitespace(s) before delimiter.";i:1;s:0:"";i:2;i:9;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER", + "len": 9, + "last": 9, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 2, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Expected whitespace(s) before delimiter.", + "", + 9, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiterErr2.out b/tests/data/lexer/lexDelimiterErr2.out index 5eaa28881..bc260a61b 100644 --- a/tests/data/lexer/lexDelimiterErr2.out +++ b/tests/data/lexer/lexDelimiterErr2.out @@ -1 +1,73 @@ -a:4:{s:5:"query";s:11:"DELIMITER ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:11:"DELIMITER ";s:3:"len";i:11;s:4:"last";i:11;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:3:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:3;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:19:"Expected delimiter.";i:1;s:0:"";i:2;i:11;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER \r", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER \r", + "len": 11, + "last": 11, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " \r", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 3, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Expected delimiter.", + "", + 11, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiterErr3.out b/tests/data/lexer/lexDelimiterErr3.out index e15047d4f..557462f9f 100644 --- a/tests/data/lexer/lexDelimiterErr3.out +++ b/tests/data/lexer/lexDelimiterErr3.out @@ -1,4 +1,82 @@ -a:4:{s:5:"query";s:11:"DELIMITER; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:11:"DELIMITER; -";s:3:"len";i:11;s:4:"last";i:11;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:4:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:4;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:19:"Expected delimiter.";i:1;s:0:"";i:2;i:10;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER;\n", + "len": 11, + "last": 11, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 4, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Expected delimiter.", + "", + 10, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexDelimiterLen.out b/tests/data/lexer/lexDelimiterLen.out index 5e3563ba7..041d31a67 100644 --- a/tests/data/lexer/lexDelimiterLen.out +++ b/tests/data/lexer/lexDelimiterLen.out @@ -1,7 +1,156 @@ -a:4:{s:5:"query";s:73:"DELIMITER abcdefghijklmnopqrstuvwxyz -SELECT 1 abcdefghijklmnopqrstuvwxyz -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:73:"DELIMITER abcdefghijklmnopqrstuvwxyz -SELECT 1 abcdefghijklmnopqrstuvwxyz -";s:3:"len";i:73;s:4:"last";i:73;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"abcdefghijklmno";s:5:"value";s:15:"abcdefghijklmno";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"pqrstuvwxyz";s:5:"value";s:11:"pqrstuvwxyz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:37;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:44;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"abcdefghijklmno";s:5:"value";s:15:"abcdefghijklmno";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:46;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"pqrstuvwxyz";s:5:"value";s:11:"pqrstuvwxyz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:0;}s:9:"delimiter";s:15:"abcdefghijklmno";s:12:"delimiterLen";i:15;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER abcdefghijklmnopqrstuvwxyz\nSELECT 1 abcdefghijklmnopqrstuvwxyz\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER abcdefghijklmnopqrstuvwxyz\nSELECT 1 abcdefghijklmnopqrstuvwxyz\n", + "len": 73, + "last": 73, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abcdefghijklmno", + "value": "abcdefghijklmno", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pqrstuvwxyz", + "value": "pqrstuvwxyz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abcdefghijklmno", + "value": "abcdefghijklmno", + "keyword": null, + "type": 9, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pqrstuvwxyz", + "value": "pqrstuvwxyz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": "abcdefghijklmno", + "delimiterLen": 15, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexKeyword.out b/tests/data/lexer/lexKeyword.out index 15061032b..c6c5028ad 100644 --- a/tests/data/lexer/lexKeyword.out +++ b/tests/data/lexer/lexKeyword.out @@ -1 +1,75 @@ -a:4:{s:5:"query";s:8:"SELECT 1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:8:"SELECT 1";s:3:"len";i:8;s:4:"last";i:8;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:4:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:4;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 1", + "len": 8, + "last": 8, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 4, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexKeyword2.out b/tests/data/lexer/lexKeyword2.out index 955329eea..ddc0f5768 100644 --- a/tests/data/lexer/lexKeyword2.out +++ b/tests/data/lexer/lexKeyword2.out @@ -1 +1,129 @@ -a:4:{s:5:"query";s:25:"SELECT tbl.TABLE FROM tbl";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:25:"SELECT tbl.TABLE FROM tbl";s:3:"len";i:25;s:4:"last";i:25;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"tbl";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"tbl";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT tbl.TABLE FROM tbl", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT tbl.TABLE FROM tbl", + "len": 25, + "last": 25, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl", + "value": "tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl", + "value": "tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexLabel1.out b/tests/data/lexer/lexLabel1.out index ccb90b23a..1c90ccf2f 100644 --- a/tests/data/lexer/lexLabel1.out +++ b/tests/data/lexer/lexLabel1.out @@ -1,31 +1,696 @@ -a:4:{s:5:"query";s:187:"CREATE PROCEDURE doiterate(p1 INT) -BEGIN - label1 : LOOP - SET p1 = p1 + 1; - IF p1 < 10 THEN - ITERATE label1; - END IF; - LEAVE label1; - END LOOP label1; - SET @x = p1; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:187:"CREATE PROCEDURE doiterate(p1 INT) -BEGIN - label1 : LOOP - SET p1 = p1 + 1; - IF p1 < 10 THEN - ITERATE label1; - END IF; - LEAVE label1; - END LOOP label1; - SET @x = p1; -END";s:3:"len";i:187;s:4:"last";i:187;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:73:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PROCEDURE";s:5:"value";s:9:"PROCEDURE";s:7:"keyword";s:9:"PROCEDURE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"doiterate";s:5:"value";s:9:"doiterate";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:30;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"label1 :";s:5:"value";s:8:"label1 :";s:7:"keyword";N;s:4:"type";i:10;s:5:"flags";i:0;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOOP";s:5:"value";s:4:"LOOP";s:7:"keyword";s:4:"LOOP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:61;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:70;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:73;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:75;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:76;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:7:"keyword";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:82;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:85;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"<";s:5:"value";s:1:"<";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:88;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:90;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"THEN";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"ITERATE";s:5:"value";s:7:"ITERATE";s:7:"keyword";s:7:"ITERATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:104;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:112;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:118;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:119;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:124;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:7:"keyword";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:130;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LEAVE";s:5:"value";s:5:"LEAVE";s:7:"keyword";s:5:"LEAVE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:136;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:141;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:142;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:148;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:149;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:152;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:155;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOOP";s:5:"value";s:4:"LOOP";s:7:"keyword";s:4:"LOOP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:156;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:161;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:167;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:168;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:171;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:174;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@x";s:5:"value";s:1:"x";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:175;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:177;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:178;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:179;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:180;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:182;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:183;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:184;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:73;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1 : LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1 : LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND", + "len": 187, + "last": 187, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PROCEDURE", + "value": "PROCEDURE", + "keyword": "PROCEDURE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "doiterate", + "value": "doiterate", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1 :", + "value": "label1 :", + "keyword": null, + "type": 10, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOOP", + "value": "LOOP", + "keyword": "LOOP", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF", + "value": "IF", + "keyword": "IF", + "type": 1, + "flags": 35, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "<", + "value": "<", + "keyword": null, + "type": 2, + "flags": 2, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "THEN", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ITERATE", + "value": "ITERATE", + "keyword": "ITERATE", + "type": 1, + "flags": 3, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF", + "value": "IF", + "keyword": "IF", + "type": 1, + "flags": 35, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEAVE", + "value": "LEAVE", + "keyword": "LEAVE", + "type": 1, + "flags": 3, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOOP", + "value": "LOOP", + "keyword": "LOOP", + "type": 1, + "flags": 3, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@x", + "value": "x", + "keyword": null, + "type": 8, + "flags": 1, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 184 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 73, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexLabel2.out b/tests/data/lexer/lexLabel2.out index 79c564847..eb17b092f 100644 --- a/tests/data/lexer/lexLabel2.out +++ b/tests/data/lexer/lexLabel2.out @@ -1,31 +1,696 @@ -a:4:{s:5:"query";s:186:"CREATE PROCEDURE doiterate(p1 INT) -BEGIN - label1: LOOP - SET p1 = p1 + 1; - IF p1 < 10 THEN - ITERATE label1; - END IF; - LEAVE label1; - END LOOP label1; - SET @x = p1; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:186:"CREATE PROCEDURE doiterate(p1 INT) -BEGIN - label1: LOOP - SET p1 = p1 + 1; - IF p1 < 10 THEN - ITERATE label1; - END IF; - LEAVE label1; - END LOOP label1; - SET @x = p1; -END";s:3:"len";i:186;s:4:"last";i:186;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:73:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PROCEDURE";s:5:"value";s:9:"PROCEDURE";s:7:"keyword";s:9:"PROCEDURE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"doiterate";s:5:"value";s:9:"doiterate";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:30;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"label1:";s:5:"value";s:7:"label1:";s:7:"keyword";N;s:4:"type";i:10;s:5:"flags";i:0;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOOP";s:5:"value";s:4:"LOOP";s:7:"keyword";s:4:"LOOP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:60;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:67;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:69;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:72;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:74;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:75;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:7:"keyword";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:81;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:83;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:84;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"<";s:5:"value";s:1:"<";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:87;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:89;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"THEN";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:92;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"ITERATE";s:5:"value";s:7:"ITERATE";s:7:"keyword";s:7:"ITERATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:103;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:111;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:117;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:123;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IF";s:5:"value";s:2:"IF";s:7:"keyword";s:2:"IF";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:127;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:129;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LEAVE";s:5:"value";s:5:"LEAVE";s:7:"keyword";s:5:"LEAVE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:135;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:140;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:141;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:147;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:151;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOOP";s:5:"value";s:4:"LOOP";s:7:"keyword";s:4:"LOOP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:155;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:159;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"label1";s:5:"value";s:6:"label1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:160;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:166;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:167;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:170;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:173;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@x";s:5:"value";s:1:"x";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:174;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:177;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:178;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:179;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:181;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:182;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:183;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:73;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND", + "len": 186, + "last": 186, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PROCEDURE", + "value": "PROCEDURE", + "keyword": "PROCEDURE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "doiterate", + "value": "doiterate", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1:", + "value": "label1:", + "keyword": null, + "type": 10, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOOP", + "value": "LOOP", + "keyword": "LOOP", + "type": 1, + "flags": 3, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF", + "value": "IF", + "keyword": "IF", + "type": 1, + "flags": 35, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "<", + "value": "<", + "keyword": null, + "type": 2, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "THEN", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ITERATE", + "value": "ITERATE", + "keyword": "ITERATE", + "type": 1, + "flags": 3, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF", + "value": "IF", + "keyword": "IF", + "type": 1, + "flags": 35, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEAVE", + "value": "LEAVE", + "keyword": "LEAVE", + "type": 1, + "flags": 3, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOOP", + "value": "LOOP", + "keyword": "LOOP", + "type": 1, + "flags": 3, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "label1", + "value": "label1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@x", + "value": "x", + "keyword": null, + "type": 8, + "flags": 1, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 73, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexNoLabel.out b/tests/data/lexer/lexNoLabel.out index 65f4e038a..165a496cd 100644 --- a/tests/data/lexer/lexNoLabel.out +++ b/tests/data/lexer/lexNoLabel.out @@ -1,4 +1,228 @@ -a:4:{s:5:"query";s:63:"SELECT wins FROM players WHERE auth = '[U1:123456789]' LIMIT 1 -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:63:"SELECT wins FROM players WHERE auth = '[U1:123456789]' LIMIT 1 -";s:3:"len";i:63;s:4:"last";i:63;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"wins";s:5:"value";s:4:"wins";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"players";s:5:"value";s:7:"players";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"auth";s:5:"value";s:4:"auth";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:36;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"'[U1:123456789]'";s:5:"value";s:14:"[U1:123456789]";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:55;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:61;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT wins FROM players WHERE auth = '[U1:123456789]' LIMIT 1\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT wins FROM players WHERE auth = '[U1:123456789]' LIMIT 1\n", + "len": 63, + "last": 63, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "wins", + "value": "wins", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "players", + "value": "players", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "auth", + "value": "auth", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'[U1:123456789]'", + "value": "[U1:123456789]", + "keyword": null, + "type": 7, + "flags": 1, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexNumber.out b/tests/data/lexer/lexNumber.out index 35ce3be49..5137a02a3 100644 --- a/tests/data/lexer/lexNumber.out +++ b/tests/data/lexer/lexNumber.out @@ -1,7 +1,642 @@ -a:4:{s:5:"query";s:159:"SELECT 12, 34, 5.67, 0x89, -10, --11, +12, .15, 0xFFa, 0xfFA, 0XFfA, -0xFFa, -0xfFA, -0XFfA, 1e-10, 1e10, .5e10, b'10'; --- invalid number -SELECT 12ex10, b'15';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:159:"SELECT 12, 34, 5.67, 0x89, -10, --11, +12, .15, 0xFFa, 0xfFA, 0XFfA, -0xFFa, -0xfFA, -0XFfA, 1e-10, 1e10, .5e10, b'10'; --- invalid number -SELECT 12ex10, b'15';";s:3:"len";i:159;s:4:"last";i:159;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:67:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"12";s:5:"value";i:12;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"34";s:5:"value";i:34;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:13;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"5.67";s:5:"value";d:5.67;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:15;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"0x89";s:5:"value";i:137;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:21;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"-10";s:5:"value";i:-10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:8;s:8:"position";i:27;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"--11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:8;s:8:"position";i:32;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"+12";s:5:"value";i:12;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:38;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:".15";s:5:"value";d:0.15;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:43;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xFFa";s:5:"value";i:4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:48;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:53;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xfFA";s:5:"value";i:4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:55;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:60;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0XFfA";s:5:"value";i:4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:62;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:67;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xFFa";s:5:"value";i:-4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:69;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:75;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xfFA";s:5:"value";i:-4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:77;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0XFfA";s:5:"value";i:-4090;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:85;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:91;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"1e-10";s:5:"value";d:1.0E-10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:4;s:8:"position";i:93;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:98;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"1e10";s:5:"value";d:10000000000;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:4;s:8:"position";i:100;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:104;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:105;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:".5e10";s:5:"value";d:5000000000;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:6;s:8:"position";i:106;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:111;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"b'10'";s:5:"value";s:5:"b'10'";s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:16;s:8:"position";i:113;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:118;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:119;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"-- invalid number";s:5:"value";s:17:"-- invalid number";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:120;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:137;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:138;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:144;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"12ex10";s:5:"value";s:6:"12ex10";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:145;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:151;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:152;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:153;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'15'";s:5:"value";s:2:"15";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:154;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:158;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:67;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 12, 34, 5.67, 0x89, -10, --11, +12, .15, 0xFFa, 0xfFA, 0XFfA, -0xFFa, -0xfFA, -0XFfA, 1e-10, 1e10, .5e10, b'10';\n-- invalid number\nSELECT 12ex10, b'15';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 12, 34, 5.67, 0x89, -10, --11, +12, .15, 0xFFa, 0xfFA, 0XFfA, -0xFFa, -0xfFA, -0XFfA, 1e-10, 1e10, .5e10, b'10';\n-- invalid number\nSELECT 12ex10, b'15';", + "len": 159, + "last": 159, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "12", + "value": 12, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "34", + "value": 34, + "keyword": null, + "type": 6, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5.67", + "value": 5.67, + "keyword": null, + "type": 6, + "flags": 2, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0x89", + "value": 137, + "keyword": null, + "type": 6, + "flags": 1, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-10", + "value": -10, + "keyword": null, + "type": 6, + "flags": 8, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "--11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 8, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+12", + "value": 12, + "keyword": null, + "type": 6, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".15", + "value": 0.15, + "keyword": null, + "type": 6, + "flags": 2, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xFFa", + "value": 4090, + "keyword": null, + "type": 6, + "flags": 1, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xfFA", + "value": 4090, + "keyword": null, + "type": 6, + "flags": 1, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0XFfA", + "value": 4090, + "keyword": null, + "type": 6, + "flags": 1, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xFFa", + "value": -4090, + "keyword": null, + "type": 6, + "flags": 9, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xfFA", + "value": -4090, + "keyword": null, + "type": 6, + "flags": 9, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0XFfA", + "value": -4090, + "keyword": null, + "type": 6, + "flags": 9, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1e-10", + "value": 1.0e-10, + "keyword": null, + "type": 6, + "flags": 4, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1e10", + "value": 10000000000.0, + "keyword": null, + "type": 6, + "flags": 4, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".5e10", + "value": 5000000000.0, + "keyword": null, + "type": 6, + "flags": 6, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b'10'", + "value": "b'10'", + "keyword": null, + "type": 6, + "flags": 16, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- invalid number", + "value": "-- invalid number", + "keyword": null, + "type": 4, + "flags": 4, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "12ex10", + "value": "12ex10", + "keyword": null, + "type": 0, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'15'", + "value": "15", + "keyword": null, + "type": 7, + "flags": 1, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 67, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexOperator.out b/tests/data/lexer/lexOperator.out index 836993536..68a66ae4f 100644 --- a/tests/data/lexer/lexOperator.out +++ b/tests/data/lexer/lexOperator.out @@ -1 +1,111 @@ -a:4:{s:5:"query";s:12:"SELECT 1 + 2";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:12:"SELECT 1 + 2";s:3:"len";i:12;s:4:"last";i:12;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 1 + 2", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 1 + 2", + "len": 12, + "last": 12, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexOperatorStarIsArithmetic.out b/tests/data/lexer/lexOperatorStarIsArithmetic.out index 0824e20c6..fff4d4f90 100644 --- a/tests/data/lexer/lexOperatorStarIsArithmetic.out +++ b/tests/data/lexer/lexOperatorStarIsArithmetic.out @@ -1,151 +1,6087 @@ -a:4:{s:5:"query";s:2429:"SELECT 2*3 -SELECT 2 * 3 -SELECT field * 8 -SELECT 8 * field -SELECT foo * bar -SELECT `escaped_field` * 16 -SELECT 16 * `escaped_field` -SELECT `foo` * `bar` -SELECT `foo`*`bar` -SELECT 1 * (SELECT COUNT(1) FROM nb_rows) -SELECT (SELECT COUNT(1) FROM nb_rows) * 1 -SELECT (SELECT COUNT(1) FROM nb_rows) * (SELECT COUNT(1) FROM nb_rows) -SELECT (1 * 1) * (2 * 2) -SELECT 1 * (2 * (3 * (4 * 5))) -SELECT 2.71 * 3.14 -SELECT 2.71 * -3.14 -SELECT -2.71 * 3.14 -SELECT -2.71 * -3.14 -SELECT 0xABC * 0xCBA -SELECT 0xABC * -0xCBA -SELECT -0xABC * 0xCBA -SELECT -0xABC * -0xCBA - --- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing) -SELECT 2 * /* comment */3 -SELECT 2/* comment */ * 3 -SELECT 2/* comment with * inside */ * 3 -SELECT /* comment */ field /* comment */ * /* comment */ 8 /* comment */ -SELECT /* comment */ 8 /* comment */ * /* comment */ field /* comment */ -SELECT /* comment */ foo /* comment */ * /* comment */ bar /* comment */ -SELECT /* comment */ `escaped_field` /* comment */ * /* comment */ 16 /* comment */ -SELECT /* comment */ 16 /* comment */ * /* comment */ `escaped_field` /* comment */ -SELECT /* comment */ `foo` /* comment */ * /* comment */ `bar` /* comment */ -SELECT /* `comment` */ `foo` /* `comment` */ * /* `comment` */ `bar` /* `comment` */ -SELECT /* comment */ 1 /* comment */ * /* comment */ (SELECT COUNT(/* comment */1/* comment */) /* comment */ FROM nb_rows) -SELECT /* comment */ (SELECT COUNT(1) /* comment */FROM/* comment */ nb_rows) /* comment */ * /* comment */ 1 -SELECT (SELECT /* comment */ COUNT(1) /* comment */ FROM /* comment */ nb_rows) /* comment */ * /* comment */ (SELECT COUNT(1) FROM nb_rows) -SELECT (1 * 1) /* comment */ * /* comment */ (2 * 2) -SELECT /* comment */ 1 /* comment */ * /* comment */ (2 /* comment */ * /* comment */ (3 /* comment */ * /* comment */ (4 /* comment */ * /* comment */ 5))) /* comment */ -SELECT 2.71 /* comment */ * /* comment */ 3.14 -SELECT 2.71 /* comment */ * /* comment */ -3.14 -SELECT -2.71 /* comment */ * /* comment */ 3.14 -SELECT -2.71 /* comment */ * /* comment */ -3.14 -SELECT 0xABC /* comment */ * /* comment */ 0xCBA -SELECT 0xABC /* comment */ * /* comment */ -0xCBA -SELECT -0xABC /* comment */ * /* comment */ 0xCBA -SELECT -0xABC /* comment */ * /* comment */ -0xCBA -SELECT 1 /* comment with FROM keyword */ * /* comment with USING keyword */1 -SELECT 1 /* comment with ) */ * /* comment with , keyword */1 - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:2429:"SELECT 2*3 -SELECT 2 * 3 -SELECT field * 8 -SELECT 8 * field -SELECT foo * bar -SELECT `escaped_field` * 16 -SELECT 16 * `escaped_field` -SELECT `foo` * `bar` -SELECT `foo`*`bar` -SELECT 1 * (SELECT COUNT(1) FROM nb_rows) -SELECT (SELECT COUNT(1) FROM nb_rows) * 1 -SELECT (SELECT COUNT(1) FROM nb_rows) * (SELECT COUNT(1) FROM nb_rows) -SELECT (1 * 1) * (2 * 2) -SELECT 1 * (2 * (3 * (4 * 5))) -SELECT 2.71 * 3.14 -SELECT 2.71 * -3.14 -SELECT -2.71 * 3.14 -SELECT -2.71 * -3.14 -SELECT 0xABC * 0xCBA -SELECT 0xABC * -0xCBA -SELECT -0xABC * 0xCBA -SELECT -0xABC * -0xCBA - --- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing) -SELECT 2 * /* comment */3 -SELECT 2/* comment */ * 3 -SELECT 2/* comment with * inside */ * 3 -SELECT /* comment */ field /* comment */ * /* comment */ 8 /* comment */ -SELECT /* comment */ 8 /* comment */ * /* comment */ field /* comment */ -SELECT /* comment */ foo /* comment */ * /* comment */ bar /* comment */ -SELECT /* comment */ `escaped_field` /* comment */ * /* comment */ 16 /* comment */ -SELECT /* comment */ 16 /* comment */ * /* comment */ `escaped_field` /* comment */ -SELECT /* comment */ `foo` /* comment */ * /* comment */ `bar` /* comment */ -SELECT /* `comment` */ `foo` /* `comment` */ * /* `comment` */ `bar` /* `comment` */ -SELECT /* comment */ 1 /* comment */ * /* comment */ (SELECT COUNT(/* comment */1/* comment */) /* comment */ FROM nb_rows) -SELECT /* comment */ (SELECT COUNT(1) /* comment */FROM/* comment */ nb_rows) /* comment */ * /* comment */ 1 -SELECT (SELECT /* comment */ COUNT(1) /* comment */ FROM /* comment */ nb_rows) /* comment */ * /* comment */ (SELECT COUNT(1) FROM nb_rows) -SELECT (1 * 1) /* comment */ * /* comment */ (2 * 2) -SELECT /* comment */ 1 /* comment */ * /* comment */ (2 /* comment */ * /* comment */ (3 /* comment */ * /* comment */ (4 /* comment */ * /* comment */ 5))) /* comment */ -SELECT 2.71 /* comment */ * /* comment */ 3.14 -SELECT 2.71 /* comment */ * /* comment */ -3.14 -SELECT -2.71 /* comment */ * /* comment */ 3.14 -SELECT -2.71 /* comment */ * /* comment */ -3.14 -SELECT 0xABC /* comment */ * /* comment */ 0xCBA -SELECT 0xABC /* comment */ * /* comment */ -0xCBA -SELECT -0xABC /* comment */ * /* comment */ 0xCBA -SELECT -0xABC /* comment */ * /* comment */ -0xCBA -SELECT 1 /* comment with FROM keyword */ * /* comment with USING keyword */1 -SELECT 1 /* comment with ) */ * /* comment with , keyword */1 - -";s:3:"len";i:2429;s:4:"last";i:2429;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:672:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:20;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:22;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"field";s:5:"value";s:5:"field";s:7:"keyword";s:5:"FIELD";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:31;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:37;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"8";s:5:"value";i:8;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:39;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:41;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"8";s:5:"value";i:8;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:48;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:50;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"field";s:5:"value";s:5:"field";s:7:"keyword";s:5:"FIELD";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:52;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:58;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:69;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:71;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:75;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`escaped_field`";s:5:"value";s:13:"escaped_field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:82;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:98;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"16";s:5:"value";i:16;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:103;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:109;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"16";s:5:"value";i:16;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:110;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:113;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`escaped_field`";s:5:"value";s:13:"escaped_field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:115;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:131;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:137;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`foo`";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:138;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:143;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:144;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`bar`";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:146;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:151;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:152;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`foo`";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:159;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:164;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`bar`";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:165;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:170;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:171;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:177;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:178;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:179;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:180;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:181;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:182;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:183;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:189;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:190;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:195;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:196;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:197;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:198;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:199;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:203;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:204;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:211;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:212;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:213;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:219;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:220;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:221;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:227;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:228;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:233;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:234;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:235;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:236;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:237;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:241;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:242;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:249;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:250;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:251;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:252;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:253;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:254;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:255;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:261;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:262;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:263;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:269;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:270;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:275;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:276;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:277;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:278;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:279;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:283;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:284;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:291;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:292;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:293;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:294;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:295;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:296;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:302;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:303;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:308;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:309;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:310;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:311;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:312;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:316;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:317;}i:134;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:324;}i:135;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:325;}i:136;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:326;}i:137;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:332;}i:138;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:333;}i:139;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:334;}i:140;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:335;}i:141;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:336;}i:142;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:337;}i:143;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:338;}i:144;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:339;}i:145;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:340;}i:146;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:341;}i:147;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:342;}i:148;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:343;}i:149;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:344;}i:150;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:345;}i:151;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:346;}i:152;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:347;}i:153;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:348;}i:154;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:349;}i:155;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:350;}i:156;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:351;}i:157;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:357;}i:158;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:358;}i:159;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:359;}i:160;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:360;}i:161;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:361;}i:162;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:362;}i:163;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:363;}i:164;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:364;}i:165;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:365;}i:166;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:366;}i:167;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:367;}i:168;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:368;}i:169;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:369;}i:170;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:370;}i:171;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:371;}i:172;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:372;}i:173;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"4";s:5:"value";i:4;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:373;}i:174;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:374;}i:175;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:375;}i:176;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:376;}i:177;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:377;}i:178;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:378;}i:179;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:379;}i:180;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:380;}i:181;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:381;}i:182;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:382;}i:183;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:388;}i:184;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2.71";s:5:"value";d:2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:389;}i:185;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:393;}i:186;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:394;}i:187;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:395;}i:188;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"3.14";s:5:"value";d:3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:396;}i:189;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:400;}i:190;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:401;}i:191;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:407;}i:192;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2.71";s:5:"value";d:2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:408;}i:193;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:412;}i:194;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:413;}i:195;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:414;}i:196;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-3.14";s:5:"value";d:-3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:415;}i:197;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:420;}i:198;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:421;}i:199;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:427;}i:200;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-2.71";s:5:"value";d:-2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:428;}i:201;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:433;}i:202;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:434;}i:203;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:435;}i:204;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"3.14";s:5:"value";d:3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:436;}i:205;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:440;}i:206;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:441;}i:207;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:447;}i:208;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-2.71";s:5:"value";d:-2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:448;}i:209;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:453;}i:210;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:454;}i:211;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:455;}i:212;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-3.14";s:5:"value";d:-3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:456;}i:213;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:461;}i:214;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:462;}i:215;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:468;}i:216;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xABC";s:5:"value";i:2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:469;}i:217;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:474;}i:218;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:475;}i:219;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:476;}i:220;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xCBA";s:5:"value";i:3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:477;}i:221;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:482;}i:222;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:483;}i:223;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:489;}i:224;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xABC";s:5:"value";i:2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:490;}i:225;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:495;}i:226;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:496;}i:227;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:497;}i:228;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xCBA";s:5:"value";i:-3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:498;}i:229;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:504;}i:230;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:505;}i:231;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:511;}i:232;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xABC";s:5:"value";i:-2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:512;}i:233;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:518;}i:234;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:519;}i:235;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:520;}i:236;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xCBA";s:5:"value";i:3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:521;}i:237;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:526;}i:238;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:527;}i:239;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:533;}i:240;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xABC";s:5:"value";i:-2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:534;}i:241;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:540;}i:242;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:541;}i:243;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:542;}i:244;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xCBA";s:5:"value";i:-3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:543;}i:245;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:549;}i:246;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:105:"-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)";s:5:"value";s:105:"-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:551;}i:247;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:656;}i:248;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:657;}i:249;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:663;}i:250;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:664;}i:251;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:665;}i:252;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:666;}i:253;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:667;}i:254;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:668;}i:255;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:681;}i:256;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:682;}i:257;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:683;}i:258;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:689;}i:259;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:690;}i:260;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:691;}i:261;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:704;}i:262;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:705;}i:263;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:706;}i:264;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:707;}i:265;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:708;}i:266;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:709;}i:267;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:715;}i:268;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:716;}i:269;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:27:"/* comment with * inside */";s:5:"value";s:27:"/* comment with * inside */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:717;}i:270;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:744;}i:271;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:745;}i:272;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:746;}i:273;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:747;}i:274;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:748;}i:275;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:749;}i:276;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:755;}i:277;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:756;}i:278;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:769;}i:279;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"field";s:5:"value";s:5:"field";s:7:"keyword";s:5:"FIELD";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:770;}i:280;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:775;}i:281;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:776;}i:282;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:789;}i:283;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:790;}i:284;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:791;}i:285;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:792;}i:286;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:805;}i:287;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"8";s:5:"value";i:8;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:806;}i:288;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:807;}i:289;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:808;}i:290;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:821;}i:291;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:822;}i:292;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:828;}i:293;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:829;}i:294;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:842;}i:295;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"8";s:5:"value";i:8;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:843;}i:296;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:844;}i:297;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:845;}i:298;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:858;}i:299;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:859;}i:300;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:860;}i:301;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:861;}i:302;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:874;}i:303;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"field";s:5:"value";s:5:"field";s:7:"keyword";s:5:"FIELD";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:875;}i:304;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:880;}i:305;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:881;}i:306;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:894;}i:307;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:895;}i:308;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:901;}i:309;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:902;}i:310;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:915;}i:311;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:916;}i:312;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:919;}i:313;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:920;}i:314;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:933;}i:315;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:934;}i:316;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:935;}i:317;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:936;}i:318;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:949;}i:319;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:950;}i:320;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:953;}i:321;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:954;}i:322;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:967;}i:323;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:968;}i:324;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:974;}i:325;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:975;}i:326;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:988;}i:327;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`escaped_field`";s:5:"value";s:13:"escaped_field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:989;}i:328;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1004;}i:329;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1005;}i:330;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1018;}i:331;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1019;}i:332;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1020;}i:333;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1021;}i:334;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1034;}i:335;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"16";s:5:"value";i:16;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1035;}i:336;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1037;}i:337;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1038;}i:338;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1051;}i:339;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1052;}i:340;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1058;}i:341;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1059;}i:342;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1072;}i:343;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"16";s:5:"value";i:16;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1073;}i:344;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1075;}i:345;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1076;}i:346;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1089;}i:347;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1090;}i:348;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1091;}i:349;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1092;}i:350;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1105;}i:351;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`escaped_field`";s:5:"value";s:13:"escaped_field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1106;}i:352;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1121;}i:353;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1122;}i:354;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1135;}i:355;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1136;}i:356;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1142;}i:357;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1143;}i:358;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1156;}i:359;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`foo`";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1157;}i:360;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1162;}i:361;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1163;}i:362;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1176;}i:363;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1177;}i:364;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1178;}i:365;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1179;}i:366;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1192;}i:367;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`bar`";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1193;}i:368;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1198;}i:369;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1199;}i:370;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1212;}i:371;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1213;}i:372;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1219;}i:373;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"/* `comment` */";s:5:"value";s:15:"/* `comment` */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1220;}i:374;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1235;}i:375;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`foo`";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1236;}i:376;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1241;}i:377;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"/* `comment` */";s:5:"value";s:15:"/* `comment` */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1242;}i:378;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1257;}i:379;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1258;}i:380;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1259;}i:381;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"/* `comment` */";s:5:"value";s:15:"/* `comment` */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1260;}i:382;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1275;}i:383;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`bar`";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1276;}i:384;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1281;}i:385;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"/* `comment` */";s:5:"value";s:15:"/* `comment` */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1282;}i:386;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1297;}i:387;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1298;}i:388;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1304;}i:389;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1305;}i:390;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1318;}i:391;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1319;}i:392;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1320;}i:393;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1321;}i:394;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1334;}i:395;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1335;}i:396;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1336;}i:397;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1337;}i:398;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1350;}i:399;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1351;}i:400;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1352;}i:401;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1358;}i:402;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:1359;}i:403;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1364;}i:404;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1365;}i:405;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1378;}i:406;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1379;}i:407;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1392;}i:408;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1393;}i:409;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1394;}i:410;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1407;}i:411;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1408;}i:412;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1412;}i:413;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1413;}i:414;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1420;}i:415;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1421;}i:416;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1422;}i:417;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1428;}i:418;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1429;}i:419;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1442;}i:420;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1443;}i:421;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1444;}i:422;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1450;}i:423;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:1451;}i:424;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1456;}i:425;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1457;}i:426;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1458;}i:427;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1459;}i:428;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1460;}i:429;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1473;}i:430;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1477;}i:431;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1490;}i:432;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1491;}i:433;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1498;}i:434;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1499;}i:435;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1500;}i:436;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1513;}i:437;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1514;}i:438;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1515;}i:439;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1516;}i:440;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1529;}i:441;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1530;}i:442;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1531;}i:443;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1532;}i:444;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1538;}i:445;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1539;}i:446;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1540;}i:447;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1546;}i:448;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1547;}i:449;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1560;}i:450;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:1561;}i:451;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1566;}i:452;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1567;}i:453;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1568;}i:454;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1569;}i:455;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1570;}i:456;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1583;}i:457;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1584;}i:458;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1588;}i:459;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1589;}i:460;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1602;}i:461;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1603;}i:462;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1610;}i:463;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1611;}i:464;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1612;}i:465;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1625;}i:466;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1626;}i:467;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1627;}i:468;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1628;}i:469;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1641;}i:470;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1642;}i:471;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1643;}i:472;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1649;}i:473;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:1650;}i:474;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1655;}i:475;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1656;}i:476;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1657;}i:477;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1658;}i:478;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1659;}i:479;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1663;}i:480;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"nb_rows";s:5:"value";s:7:"nb_rows";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1664;}i:481;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1671;}i:482;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1672;}i:483;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1673;}i:484;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1679;}i:485;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1680;}i:486;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1681;}i:487;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1682;}i:488;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1683;}i:489;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1684;}i:490;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1685;}i:491;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1686;}i:492;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1687;}i:493;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1688;}i:494;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1701;}i:495;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1702;}i:496;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1703;}i:497;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1704;}i:498;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1717;}i:499;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1718;}i:500;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1719;}i:501;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1720;}i:502;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1721;}i:503;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1722;}i:504;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1723;}i:505;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1724;}i:506;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1725;}i:507;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1726;}i:508;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1732;}i:509;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1733;}i:510;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1746;}i:511;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1747;}i:512;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1748;}i:513;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1749;}i:514;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1762;}i:515;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1763;}i:516;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1764;}i:517;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1765;}i:518;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1778;}i:519;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1779;}i:520;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1780;}i:521;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1781;}i:522;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1782;}i:523;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1795;}i:524;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1796;}i:525;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1797;}i:526;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1798;}i:527;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1811;}i:528;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1812;}i:529;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1813;}i:530;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1814;}i:531;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1815;}i:532;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1828;}i:533;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1829;}i:534;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1830;}i:535;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1831;}i:536;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1844;}i:537;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1845;}i:538;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"4";s:5:"value";i:4;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1846;}i:539;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1847;}i:540;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1848;}i:541;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1861;}i:542;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1862;}i:543;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1863;}i:544;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1864;}i:545;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1877;}i:546;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1878;}i:547;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1879;}i:548;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1880;}i:549;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1881;}i:550;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1882;}i:551;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1883;}i:552;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1896;}i:553;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1897;}i:554;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1903;}i:555;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2.71";s:5:"value";d:2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:1904;}i:556;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1908;}i:557;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1909;}i:558;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1922;}i:559;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1923;}i:560;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1924;}i:561;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1925;}i:562;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1938;}i:563;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"3.14";s:5:"value";d:3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:1939;}i:564;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1943;}i:565;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1944;}i:566;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1950;}i:567;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2.71";s:5:"value";d:2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:1951;}i:568;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1955;}i:569;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1956;}i:570;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1969;}i:571;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:1970;}i:572;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1971;}i:573;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1972;}i:574;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1985;}i:575;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-3.14";s:5:"value";d:-3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:1986;}i:576;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1991;}i:577;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1992;}i:578;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1998;}i:579;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-2.71";s:5:"value";d:-2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:1999;}i:580;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2004;}i:581;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2005;}i:582;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2018;}i:583;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2019;}i:584;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2020;}i:585;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2021;}i:586;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2034;}i:587;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"3.14";s:5:"value";d:3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:2;s:8:"position";i:2035;}i:588;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2039;}i:589;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2040;}i:590;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2046;}i:591;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-2.71";s:5:"value";d:-2.71;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:2047;}i:592;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2052;}i:593;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2053;}i:594;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2066;}i:595;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2067;}i:596;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2068;}i:597;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2069;}i:598;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2082;}i:599;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"-3.14";s:5:"value";d:-3.14;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:10;s:8:"position";i:2083;}i:600;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2088;}i:601;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2089;}i:602;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2095;}i:603;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xABC";s:5:"value";i:2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:2096;}i:604;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2101;}i:605;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2102;}i:606;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2115;}i:607;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2116;}i:608;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2117;}i:609;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2118;}i:610;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2131;}i:611;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xCBA";s:5:"value";i:3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:2132;}i:612;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2137;}i:613;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2138;}i:614;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2144;}i:615;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xABC";s:5:"value";i:2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:2145;}i:616;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2150;}i:617;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2151;}i:618;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2164;}i:619;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2165;}i:620;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2166;}i:621;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2167;}i:622;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2180;}i:623;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xCBA";s:5:"value";i:-3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:2181;}i:624;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2187;}i:625;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2188;}i:626;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2194;}i:627;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xABC";s:5:"value";i:-2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:2195;}i:628;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2201;}i:629;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2202;}i:630;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2215;}i:631;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2216;}i:632;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2217;}i:633;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2218;}i:634;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2231;}i:635;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"0xCBA";s:5:"value";i:3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:1;s:8:"position";i:2232;}i:636;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2237;}i:637;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2238;}i:638;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2244;}i:639;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xABC";s:5:"value";i:-2748;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:2245;}i:640;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2251;}i:641;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2252;}i:642;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2265;}i:643;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2266;}i:644;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2267;}i:645;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2268;}i:646;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2281;}i:647;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"-0xCBA";s:5:"value";i:-3258;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:9;s:8:"position";i:2282;}i:648;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2288;}i:649;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2289;}i:650;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2295;}i:651;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:2296;}i:652;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2297;}i:653;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:31:"/* comment with FROM keyword */";s:5:"value";s:31:"/* comment with FROM keyword */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2298;}i:654;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2329;}i:655;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2330;}i:656;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2331;}i:657;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:32:"/* comment with USING keyword */";s:5:"value";s:32:"/* comment with USING keyword */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2332;}i:658;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:2364;}i:659;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2365;}i:660;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:2366;}i:661;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2372;}i:662;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:2373;}i:663;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2374;}i:664;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* comment with ) */";s:5:"value";s:20:"/* comment with ) */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2375;}i:665;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2395;}i:666;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:2396;}i:667;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2397;}i:668;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:28:"/* comment with , keyword */";s:5:"value";s:28:"/* comment with , keyword */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:2398;}i:669;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:2426;}i:670;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:2427;}i:671;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:672;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 2*3\nSELECT 2 * 3\nSELECT field * 8\nSELECT 8 * field\nSELECT foo * bar\nSELECT `escaped_field` * 16\nSELECT 16 * `escaped_field`\nSELECT `foo` * `bar`\nSELECT `foo`*`bar`\nSELECT 1 * (SELECT COUNT(1) FROM nb_rows)\nSELECT (SELECT COUNT(1) FROM nb_rows) * 1\nSELECT (SELECT COUNT(1) FROM nb_rows) * (SELECT COUNT(1) FROM nb_rows)\nSELECT (1 * 1) * (2 * 2)\nSELECT 1 * (2 * (3 * (4 * 5)))\nSELECT 2.71 * 3.14\nSELECT 2.71 * -3.14\nSELECT -2.71 * 3.14\nSELECT -2.71 * -3.14\nSELECT 0xABC * 0xCBA\nSELECT 0xABC * -0xCBA\nSELECT -0xABC * 0xCBA\nSELECT -0xABC * -0xCBA\n\n-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)\nSELECT 2 * \/* comment *\/3\nSELECT 2\/* comment *\/ * 3\nSELECT 2\/* comment with * inside *\/ * 3\nSELECT \/* comment *\/ field \/* comment *\/ * \/* comment *\/ 8 \/* comment *\/\nSELECT \/* comment *\/ 8 \/* comment *\/ * \/* comment *\/ field \/* comment *\/\nSELECT \/* comment *\/ foo \/* comment *\/ * \/* comment *\/ bar \/* comment *\/\nSELECT \/* comment *\/ `escaped_field` \/* comment *\/ * \/* comment *\/ 16 \/* comment *\/\nSELECT \/* comment *\/ 16 \/* comment *\/ * \/* comment *\/ `escaped_field` \/* comment *\/\nSELECT \/* comment *\/ `foo` \/* comment *\/ * \/* comment *\/ `bar` \/* comment *\/\nSELECT \/* `comment` *\/ `foo` \/* `comment` *\/ * \/* `comment` *\/ `bar` \/* `comment` *\/\nSELECT \/* comment *\/ 1 \/* comment *\/ * \/* comment *\/ (SELECT COUNT(\/* comment *\/1\/* comment *\/) \/* comment *\/ FROM nb_rows)\nSELECT \/* comment *\/ (SELECT COUNT(1) \/* comment *\/FROM\/* comment *\/ nb_rows) \/* comment *\/ * \/* comment *\/ 1\nSELECT (SELECT \/* comment *\/ COUNT(1) \/* comment *\/ FROM \/* comment *\/ nb_rows) \/* comment *\/ * \/* comment *\/ (SELECT COUNT(1) FROM nb_rows)\nSELECT (1 * 1) \/* comment *\/ * \/* comment *\/ (2 * 2)\nSELECT \/* comment *\/ 1 \/* comment *\/ * \/* comment *\/ (2 \/* comment *\/ * \/* comment *\/ (3 \/* comment *\/ * \/* comment *\/ (4 \/* comment *\/ * \/* comment *\/ 5))) \/* comment *\/\nSELECT 2.71 \/* comment *\/ * \/* comment *\/ 3.14\nSELECT 2.71 \/* comment *\/ * \/* comment *\/ -3.14\nSELECT -2.71 \/* comment *\/ * \/* comment *\/ 3.14\nSELECT -2.71 \/* comment *\/ * \/* comment *\/ -3.14\nSELECT 0xABC \/* comment *\/ * \/* comment *\/ 0xCBA\nSELECT 0xABC \/* comment *\/ * \/* comment *\/ -0xCBA\nSELECT -0xABC \/* comment *\/ * \/* comment *\/ 0xCBA\nSELECT -0xABC \/* comment *\/ * \/* comment *\/ -0xCBA\nSELECT 1 \/* comment with FROM keyword *\/ * \/* comment with USING keyword *\/1\nSELECT 1 \/* comment with ) *\/ * \/* comment with , keyword *\/1\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 2*3\nSELECT 2 * 3\nSELECT field * 8\nSELECT 8 * field\nSELECT foo * bar\nSELECT `escaped_field` * 16\nSELECT 16 * `escaped_field`\nSELECT `foo` * `bar`\nSELECT `foo`*`bar`\nSELECT 1 * (SELECT COUNT(1) FROM nb_rows)\nSELECT (SELECT COUNT(1) FROM nb_rows) * 1\nSELECT (SELECT COUNT(1) FROM nb_rows) * (SELECT COUNT(1) FROM nb_rows)\nSELECT (1 * 1) * (2 * 2)\nSELECT 1 * (2 * (3 * (4 * 5)))\nSELECT 2.71 * 3.14\nSELECT 2.71 * -3.14\nSELECT -2.71 * 3.14\nSELECT -2.71 * -3.14\nSELECT 0xABC * 0xCBA\nSELECT 0xABC * -0xCBA\nSELECT -0xABC * 0xCBA\nSELECT -0xABC * -0xCBA\n\n-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)\nSELECT 2 * \/* comment *\/3\nSELECT 2\/* comment *\/ * 3\nSELECT 2\/* comment with * inside *\/ * 3\nSELECT \/* comment *\/ field \/* comment *\/ * \/* comment *\/ 8 \/* comment *\/\nSELECT \/* comment *\/ 8 \/* comment *\/ * \/* comment *\/ field \/* comment *\/\nSELECT \/* comment *\/ foo \/* comment *\/ * \/* comment *\/ bar \/* comment *\/\nSELECT \/* comment *\/ `escaped_field` \/* comment *\/ * \/* comment *\/ 16 \/* comment *\/\nSELECT \/* comment *\/ 16 \/* comment *\/ * \/* comment *\/ `escaped_field` \/* comment *\/\nSELECT \/* comment *\/ `foo` \/* comment *\/ * \/* comment *\/ `bar` \/* comment *\/\nSELECT \/* `comment` *\/ `foo` \/* `comment` *\/ * \/* `comment` *\/ `bar` \/* `comment` *\/\nSELECT \/* comment *\/ 1 \/* comment *\/ * \/* comment *\/ (SELECT COUNT(\/* comment *\/1\/* comment *\/) \/* comment *\/ FROM nb_rows)\nSELECT \/* comment *\/ (SELECT COUNT(1) \/* comment *\/FROM\/* comment *\/ nb_rows) \/* comment *\/ * \/* comment *\/ 1\nSELECT (SELECT \/* comment *\/ COUNT(1) \/* comment *\/ FROM \/* comment *\/ nb_rows) \/* comment *\/ * \/* comment *\/ (SELECT COUNT(1) FROM nb_rows)\nSELECT (1 * 1) \/* comment *\/ * \/* comment *\/ (2 * 2)\nSELECT \/* comment *\/ 1 \/* comment *\/ * \/* comment *\/ (2 \/* comment *\/ * \/* comment *\/ (3 \/* comment *\/ * \/* comment *\/ (4 \/* comment *\/ * \/* comment *\/ 5))) \/* comment *\/\nSELECT 2.71 \/* comment *\/ * \/* comment *\/ 3.14\nSELECT 2.71 \/* comment *\/ * \/* comment *\/ -3.14\nSELECT -2.71 \/* comment *\/ * \/* comment *\/ 3.14\nSELECT -2.71 \/* comment *\/ * \/* comment *\/ -3.14\nSELECT 0xABC \/* comment *\/ * \/* comment *\/ 0xCBA\nSELECT 0xABC \/* comment *\/ * \/* comment *\/ -0xCBA\nSELECT -0xABC \/* comment *\/ * \/* comment *\/ 0xCBA\nSELECT -0xABC \/* comment *\/ * \/* comment *\/ -0xCBA\nSELECT 1 \/* comment with FROM keyword *\/ * \/* comment with USING keyword *\/1\nSELECT 1 \/* comment with ) *\/ * \/* comment with , keyword *\/1\n\n", + "len": 2429, + "last": 2429, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "field", + "value": "field", + "keyword": "FIELD", + "type": 1, + "flags": 33, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "8", + "value": 8, + "keyword": null, + "type": 6, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "8", + "value": 8, + "keyword": null, + "type": 6, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "field", + "value": "field", + "keyword": "FIELD", + "type": 1, + "flags": 33, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`escaped_field`", + "value": "escaped_field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "16", + "value": 16, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "16", + "value": 16, + "keyword": null, + "type": 6, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`escaped_field`", + "value": "escaped_field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`foo`", + "value": "foo", + "keyword": null, + "type": 8, + "flags": 2, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`bar`", + "value": "bar", + "keyword": null, + "type": 8, + "flags": 2, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`foo`", + "value": "foo", + "keyword": null, + "type": 8, + "flags": 2, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`bar`", + "value": "bar", + "keyword": null, + "type": 8, + "flags": 2, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 198 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 199 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 203 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 204 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 213 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 220 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 227 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 228 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 233 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 234 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 235 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 236 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 237 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 242 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 249 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 250 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 251 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 253 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 255 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 261 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 262 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 263 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 269 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 270 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 275 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 276 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 277 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 278 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 279 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 283 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 284 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 291 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 292 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 293 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 294 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 295 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 296 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 302 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 303 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 308 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 309 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 310 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 311 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 312 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 316 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 317 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 324 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 325 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 326 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 332 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 333 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 334 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 335 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 336 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 337 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 338 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 339 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 340 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 341 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 342 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 343 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 344 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 345 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 346 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 347 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 348 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 349 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 350 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 351 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 357 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 358 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 359 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 360 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 361 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 362 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 363 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 364 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 365 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 366 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 367 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 368 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 369 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 370 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 371 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 372 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "4", + "value": 4, + "keyword": null, + "type": 6, + "flags": 0, + "position": 373 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 374 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 375 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 376 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 377 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 378 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 379 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 380 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 381 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 382 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 388 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2.71", + "value": 2.71, + "keyword": null, + "type": 6, + "flags": 2, + "position": 389 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 393 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 394 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 395 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3.14", + "value": 3.14, + "keyword": null, + "type": 6, + "flags": 2, + "position": 396 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 400 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 401 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 407 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2.71", + "value": 2.71, + "keyword": null, + "type": 6, + "flags": 2, + "position": 408 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 412 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 413 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 414 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-3.14", + "value": -3.14, + "keyword": null, + "type": 6, + "flags": 10, + "position": 415 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 420 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 421 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 427 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-2.71", + "value": -2.71, + "keyword": null, + "type": 6, + "flags": 10, + "position": 428 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 433 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 434 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 435 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3.14", + "value": 3.14, + "keyword": null, + "type": 6, + "flags": 2, + "position": 436 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 440 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 441 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 447 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-2.71", + "value": -2.71, + "keyword": null, + "type": 6, + "flags": 10, + "position": 448 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 453 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 454 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 455 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-3.14", + "value": -3.14, + "keyword": null, + "type": 6, + "flags": 10, + "position": 456 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 461 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 462 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 468 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xABC", + "value": 2748, + "keyword": null, + "type": 6, + "flags": 1, + "position": 469 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 474 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 475 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 476 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xCBA", + "value": 3258, + "keyword": null, + "type": 6, + "flags": 1, + "position": 477 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 482 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 483 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 489 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xABC", + "value": 2748, + "keyword": null, + "type": 6, + "flags": 1, + "position": 490 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 495 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 496 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 497 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xCBA", + "value": -3258, + "keyword": null, + "type": 6, + "flags": 9, + "position": 498 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 504 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 505 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 511 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xABC", + "value": -2748, + "keyword": null, + "type": 6, + "flags": 9, + "position": 512 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 518 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 519 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 520 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xCBA", + "value": 3258, + "keyword": null, + "type": 6, + "flags": 1, + "position": 521 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 526 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 527 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 533 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xABC", + "value": -2748, + "keyword": null, + "type": 6, + "flags": 9, + "position": 534 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 540 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 541 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 542 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xCBA", + "value": -3258, + "keyword": null, + "type": 6, + "flags": 9, + "position": 543 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 549 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)", + "value": "-- Now same but with comments inside (C style comments could conflicts with operator if lexer is failing)", + "keyword": null, + "type": 4, + "flags": 4, + "position": 551 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 656 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 657 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 663 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 664 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 665 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 666 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 667 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 668 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 681 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 682 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 683 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 689 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 690 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 691 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 704 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 705 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 706 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 707 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 708 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 709 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 715 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 716 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with * inside *\/", + "value": "\/* comment with * inside *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 717 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 744 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 745 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 746 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 747 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 748 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 749 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 755 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 756 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 769 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "field", + "value": "field", + "keyword": "FIELD", + "type": 1, + "flags": 33, + "position": 770 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 775 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 776 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 789 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 790 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 791 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 792 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 805 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "8", + "value": 8, + "keyword": null, + "type": 6, + "flags": 0, + "position": 806 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 807 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 808 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 821 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 822 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 828 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 829 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 842 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "8", + "value": 8, + "keyword": null, + "type": 6, + "flags": 0, + "position": 843 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 844 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 845 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 858 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 859 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 860 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 861 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 874 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "field", + "value": "field", + "keyword": "FIELD", + "type": 1, + "flags": 33, + "position": 875 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 880 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 881 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 894 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 895 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 901 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 902 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 915 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 916 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 919 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 920 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 933 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 934 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 935 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 936 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 949 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 950 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 953 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 954 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 967 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 968 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 974 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 975 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 988 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`escaped_field`", + "value": "escaped_field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 989 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1004 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1005 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1018 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1019 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1020 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1021 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1034 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "16", + "value": 16, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1035 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1037 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1038 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1051 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1052 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1058 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1059 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1072 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "16", + "value": 16, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1073 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1075 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1076 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1089 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1090 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1091 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1092 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`escaped_field`", + "value": "escaped_field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`foo`", + "value": "foo", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1192 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`bar`", + "value": "bar", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1193 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1198 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1199 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1213 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* `comment` *\/", + "value": "\/* `comment` *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1220 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1235 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`foo`", + "value": "foo", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1236 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* `comment` *\/", + "value": "\/* `comment` *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1242 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1257 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1258 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1259 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* `comment` *\/", + "value": "\/* `comment` *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1260 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1275 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`bar`", + "value": "bar", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1276 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1281 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* `comment` *\/", + "value": "\/* `comment` *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1282 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1297 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1304 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1305 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1318 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1319 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1320 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1321 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1334 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1335 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1336 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1337 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1350 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1351 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1352 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1358 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 1359 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1364 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1365 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1378 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1379 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1392 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1393 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1394 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1407 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1408 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1412 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1413 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1420 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1421 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1422 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1428 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1429 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1442 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1443 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1444 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1450 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 1451 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1456 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1457 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1458 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1459 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1460 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1473 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1477 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1490 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1491 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1498 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1499 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1500 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1513 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1514 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1515 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1516 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1529 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1530 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1531 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1532 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1538 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1539 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1540 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1546 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1547 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1560 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 1561 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1566 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1567 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1568 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1569 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1570 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1583 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1584 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1588 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1589 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1602 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1603 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1610 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1611 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1612 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1625 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1626 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1627 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1628 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1641 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1642 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1643 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1649 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 1650 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1655 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1656 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1657 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1658 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1659 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1663 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "nb_rows", + "value": "nb_rows", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1664 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1671 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1672 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1673 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1679 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1680 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1681 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1682 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1683 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1684 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1685 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1686 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1687 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1688 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1701 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1702 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1703 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1704 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1717 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1718 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1719 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1720 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1721 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1722 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1723 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1724 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1725 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1726 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1732 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1733 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1746 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1747 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1748 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1749 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1762 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1763 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1764 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1765 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1778 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1779 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1780 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1781 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1782 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1795 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1796 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1797 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1798 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1811 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1812 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1813 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1814 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1815 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1828 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1829 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1830 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1831 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1844 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1845 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "4", + "value": 4, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1846 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1847 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1848 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1861 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1862 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1863 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1864 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1877 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1878 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1879 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1880 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1881 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1882 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1883 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1896 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1897 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1903 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2.71", + "value": 2.71, + "keyword": null, + "type": 6, + "flags": 2, + "position": 1904 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1908 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1909 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1922 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1923 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1924 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1925 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1938 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3.14", + "value": 3.14, + "keyword": null, + "type": 6, + "flags": 2, + "position": 1939 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1943 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1944 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1950 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2.71", + "value": 2.71, + "keyword": null, + "type": 6, + "flags": 2, + "position": 1951 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1955 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1956 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1969 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 1970 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1971 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1972 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1985 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-3.14", + "value": -3.14, + "keyword": null, + "type": 6, + "flags": 10, + "position": 1986 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1991 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1992 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1998 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-2.71", + "value": -2.71, + "keyword": null, + "type": 6, + "flags": 10, + "position": 1999 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2004 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2005 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2018 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2019 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2020 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2021 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2034 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3.14", + "value": 3.14, + "keyword": null, + "type": 6, + "flags": 2, + "position": 2035 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2039 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2040 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2046 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-2.71", + "value": -2.71, + "keyword": null, + "type": 6, + "flags": 10, + "position": 2047 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2052 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2053 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2066 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2067 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2068 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2069 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2082 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-3.14", + "value": -3.14, + "keyword": null, + "type": 6, + "flags": 10, + "position": 2083 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2088 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2089 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2095 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xABC", + "value": 2748, + "keyword": null, + "type": 6, + "flags": 1, + "position": 2096 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xCBA", + "value": 3258, + "keyword": null, + "type": 6, + "flags": 1, + "position": 2132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xABC", + "value": 2748, + "keyword": null, + "type": 6, + "flags": 1, + "position": 2145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xCBA", + "value": -3258, + "keyword": null, + "type": 6, + "flags": 9, + "position": 2181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2194 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xABC", + "value": -2748, + "keyword": null, + "type": 6, + "flags": 9, + "position": 2195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2215 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2216 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2217 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2231 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0xCBA", + "value": 3258, + "keyword": null, + "type": 6, + "flags": 1, + "position": 2232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2237 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2238 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xABC", + "value": -2748, + "keyword": null, + "type": 6, + "flags": 9, + "position": 2245 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2251 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2265 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2266 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2267 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2268 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2281 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-0xCBA", + "value": -3258, + "keyword": null, + "type": 6, + "flags": 9, + "position": 2282 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2288 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2289 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2295 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 2296 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2297 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with FROM keyword *\/", + "value": "\/* comment with FROM keyword *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2329 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2330 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2331 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with USING keyword *\/", + "value": "\/* comment with USING keyword *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2332 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 2364 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2365 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 2366 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2372 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 2373 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2374 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with ) *\/", + "value": "\/* comment with ) *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2375 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2395 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 2396 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2397 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with , keyword *\/", + "value": "\/* comment with , keyword *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 2398 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 2426 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 2427 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 672, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexOperatorStarIsWildcard.out b/tests/data/lexer/lexOperatorStarIsWildcard.out index bf0b032d2..c2d62a969 100644 --- a/tests/data/lexer/lexOperatorStarIsWildcard.out +++ b/tests/data/lexer/lexOperatorStarIsWildcard.out @@ -1,103 +1,3477 @@ -a:4:{s:5:"query";s:1348:"SELECT * FROM -SELECT *FROM -SELECT a.* FROM -SELECT a.*,b.* FROM -SELECT a.*, b.* FROM -SELECT a.*, /* with a comment */ b.* FROM -SELECT a.*,/* with a comment */b.* FROM -SELECT a.* /* comment */ FROM --- SELECT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.) -SELECT DISTINCT * FROM -SELECT DISTINCT *FROM -SELECT DISTINCT a.* FROM -SELECT DISTINCT a.*,b.* FROM -SELECT DISTINCT a.*, b.* FROM -SELECT DISTINCT a.*, /* with a comment */ b.* FROM -SELECT DISTINCT a.*,/* with a comment */b.* FROM -SELECT DISTINCT a.* /* comment */ FROM --- SELECT DISTINCT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.) -SELECT `*` FROM table_name -SELECT `*`.* FROM table_name AS `*` -SELECT COUNT(*) FROM table_name -SELECT COUNT( * ) FROM table_name -SELECT COUNT( * /* comment with *,USING,FROM */) FROM table_name -SELECT COUNT(`*`) FROM table_name -SELECT 1 FROM table_name WHERE LABEL LIKE '%*%' -DELETE a.* USING -DELETE a.*, b.* USING -DELETE a.* ,b.* USING -DELETE a.* , b.* USING -DELETE a.* /* comment */ USING -DELETE a.* /* comment */, b.* /*comment*/ USING -DELETE a.* /* comment */ ,b.* /*comment*/ USING -DELETE a.* /* comment */ , b.* /*comment*/ USING - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:1348:"SELECT * FROM -SELECT *FROM -SELECT a.* FROM -SELECT a.*,b.* FROM -SELECT a.*, b.* FROM -SELECT a.*, /* with a comment */ b.* FROM -SELECT a.*,/* with a comment */b.* FROM -SELECT a.* /* comment */ FROM --- SELECT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.) -SELECT DISTINCT * FROM -SELECT DISTINCT *FROM -SELECT DISTINCT a.* FROM -SELECT DISTINCT a.*,b.* FROM -SELECT DISTINCT a.*, b.* FROM -SELECT DISTINCT a.*, /* with a comment */ b.* FROM -SELECT DISTINCT a.*,/* with a comment */b.* FROM -SELECT DISTINCT a.* /* comment */ FROM --- SELECT DISTINCT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.) -SELECT `*` FROM table_name -SELECT `*`.* FROM table_name AS `*` -SELECT COUNT(*) FROM table_name -SELECT COUNT( * ) FROM table_name -SELECT COUNT( * /* comment with *,USING,FROM */) FROM table_name -SELECT COUNT(`*`) FROM table_name -SELECT 1 FROM table_name WHERE LABEL LIKE '%*%' -DELETE a.* USING -DELETE a.*, b.* USING -DELETE a.* ,b.* USING -DELETE a.* , b.* USING -DELETE a.* /* comment */ USING -DELETE a.* /* comment */, b.* /*comment*/ USING -DELETE a.* /* comment */ ,b.* /*comment*/ USING -DELETE a.* /* comment */ , b.* /*comment*/ USING - -";s:3:"len";i:1348;s:4:"last";i:1348;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:382:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:38;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:43;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:51;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:53;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:54;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:56;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:58;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:70;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:72;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:76;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:77;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:79;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:83;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:84;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:91;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:92;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:93;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:94;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* with a comment */";s:5:"value";s:20:"/* with a comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:96;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:116;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:117;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:118;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:119;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:121;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:133;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:134;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:135;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:136;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* with a comment */";s:5:"value";s:20:"/* with a comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:137;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:157;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:158;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:159;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:161;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:165;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:166;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:172;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:173;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:174;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:175;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:177;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:190;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:191;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:195;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:168:"-- SELECT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.)";s:5:"value";s:168:"-- SELECT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.)";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:196;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:364;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:365;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:371;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:372;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:380;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:381;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:382;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:383;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:387;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:388;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:394;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:395;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:403;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:404;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:405;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:409;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:410;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:416;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:417;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:425;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:426;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:427;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:428;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:429;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:430;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:434;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:435;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:441;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:442;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:450;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:451;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:452;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:453;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:454;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:455;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:456;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:457;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:458;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:459;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:463;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:464;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:470;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:471;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:479;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:480;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:481;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:482;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:483;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:484;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:485;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:486;}i:134;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:487;}i:135;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:488;}i:136;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:489;}i:137;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:493;}i:138;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:494;}i:139;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:500;}i:140;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:501;}i:141;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:509;}i:142;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:510;}i:143;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:511;}i:144;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:512;}i:145;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:513;}i:146;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:514;}i:147;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* with a comment */";s:5:"value";s:20:"/* with a comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:515;}i:148;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:535;}i:149;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:536;}i:150;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:537;}i:151;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:538;}i:152;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:539;}i:153;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:540;}i:154;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:544;}i:155;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:545;}i:156;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:551;}i:157;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:552;}i:158;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:560;}i:159;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:561;}i:160;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:562;}i:161;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:563;}i:162;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:564;}i:163;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* with a comment */";s:5:"value";s:20:"/* with a comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:565;}i:164;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:585;}i:165;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:586;}i:166;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:587;}i:167;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:588;}i:168;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:589;}i:169;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:593;}i:170;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:594;}i:171;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:600;}i:172;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:601;}i:173;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:609;}i:174;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:610;}i:175;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:611;}i:176;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:612;}i:177;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:613;}i:178;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:614;}i:179;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:627;}i:180;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:628;}i:181;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:632;}i:182;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:177:"-- SELECT DISTINCT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.)";s:5:"value";s:177:"-- SELECT DISTINCT a.*/* comment */ FROM (This one is not working yet because of https://github.com/phpmyadmin/sql-parser/issues/285. Please uncomment when this issue is fixed.)";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:633;}i:183;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:810;}i:184;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:811;}i:185;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:817;}i:186;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:818;}i:187;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:821;}i:188;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:822;}i:189;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:826;}i:190;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:827;}i:191;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:837;}i:192;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:838;}i:193;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:844;}i:194;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:845;}i:195;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:848;}i:196;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:849;}i:197;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:850;}i:198;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:851;}i:199;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:855;}i:200;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:856;}i:201;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:866;}i:202;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:867;}i:203;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:869;}i:204;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:870;}i:205;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:873;}i:206;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:874;}i:207;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:880;}i:208;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:881;}i:209;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:886;}i:210;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:887;}i:211;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:888;}i:212;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:889;}i:213;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:890;}i:214;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:894;}i:215;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:895;}i:216;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:905;}i:217;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:906;}i:218;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:912;}i:219;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:913;}i:220;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:918;}i:221;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:919;}i:222;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:920;}i:223;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:921;}i:224;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:922;}i:225;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:923;}i:226;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:924;}i:227;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:928;}i:228;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:929;}i:229;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:939;}i:230;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:940;}i:231;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:946;}i:232;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:947;}i:233;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:952;}i:234;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:953;}i:235;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:954;}i:236;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:955;}i:237;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:31:"/* comment with *,USING,FROM */";s:5:"value";s:31:"/* comment with *,USING,FROM */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:956;}i:238;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:987;}i:239;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:988;}i:240;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:989;}i:241;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:993;}i:242;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:994;}i:243;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1004;}i:244;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1005;}i:245;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1011;}i:246;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"COUNT";s:5:"value";s:5:"COUNT";s:7:"keyword";s:5:"COUNT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:1012;}i:247;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1017;}i:248;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:1018;}i:249;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1021;}i:250;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1022;}i:251;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1023;}i:252;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1027;}i:253;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:1028;}i:254;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1038;}i:255;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1039;}i:256;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1045;}i:257;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:1046;}i:258;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1047;}i:259;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1048;}i:260;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1052;}i:261;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"table_name";s:5:"value";s:10:"table_name";s:7:"keyword";s:10:"TABLE_NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:1053;}i:262;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1063;}i:263;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1064;}i:264;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1069;}i:265;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LABEL";s:5:"value";s:5:"LABEL";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1070;}i:266;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1075;}i:267;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LIKE";s:5:"value";s:4:"LIKE";s:7:"keyword";s:4:"LIKE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1076;}i:268;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1080;}i:269;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'%*%'";s:5:"value";s:3:"%*%";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:1081;}i:270;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1086;}i:271;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1087;}i:272;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1093;}i:273;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1094;}i:274;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1095;}i:275;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1096;}i:276;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1097;}i:277;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1098;}i:278;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1103;}i:279;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1104;}i:280;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1110;}i:281;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1111;}i:282;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1112;}i:283;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1113;}i:284;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1114;}i:285;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1115;}i:286;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1116;}i:287;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1117;}i:288;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1118;}i:289;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1119;}i:290;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1120;}i:291;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1125;}i:292;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1126;}i:293;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1132;}i:294;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1133;}i:295;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1134;}i:296;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1135;}i:297;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1136;}i:298;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1137;}i:299;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1138;}i:300;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1139;}i:301;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1140;}i:302;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1141;}i:303;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1142;}i:304;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1147;}i:305;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1148;}i:306;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1154;}i:307;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1155;}i:308;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1156;}i:309;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1157;}i:310;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1158;}i:311;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1159;}i:312;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1160;}i:313;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1161;}i:314;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1162;}i:315;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1163;}i:316;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1164;}i:317;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1165;}i:318;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1170;}i:319;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1171;}i:320;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1177;}i:321;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1178;}i:322;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1179;}i:323;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1180;}i:324;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1181;}i:325;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1182;}i:326;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1195;}i:327;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1196;}i:328;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1201;}i:329;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1202;}i:330;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1208;}i:331;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1209;}i:332;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1210;}i:333;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1211;}i:334;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1212;}i:335;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1213;}i:336;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1226;}i:337;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1227;}i:338;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1228;}i:339;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1229;}i:340;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1230;}i:341;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1231;}i:342;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"/*comment*/";s:5:"value";s:11:"/*comment*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1232;}i:343;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1243;}i:344;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1244;}i:345;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1249;}i:346;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1250;}i:347;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1256;}i:348;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1257;}i:349;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1258;}i:350;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1259;}i:351;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1260;}i:352;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1261;}i:353;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1274;}i:354;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1275;}i:355;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1276;}i:356;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1277;}i:357;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1278;}i:358;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1279;}i:359;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"/*comment*/";s:5:"value";s:11:"/*comment*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1280;}i:360;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1291;}i:361;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1292;}i:362;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1297;}i:363;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1298;}i:364;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1304;}i:365;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1305;}i:366;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1306;}i:367;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1307;}i:368;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1308;}i:369;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1309;}i:370;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1322;}i:371;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1323;}i:372;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1324;}i:373;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:1325;}i:374;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1326;}i:375;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:1327;}i:376;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1328;}i:377;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"/*comment*/";s:5:"value";s:11:"/*comment*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:1329;}i:378;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1340;}i:379;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1341;}i:380;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:1346;}i:381;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:382;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM\nSELECT *FROM\nSELECT a.* FROM\nSELECT a.*,b.* FROM\nSELECT a.*, b.* FROM\nSELECT a.*, \/* with a comment *\/ b.* FROM\nSELECT a.*,\/* with a comment *\/b.* FROM\nSELECT a.* \/* comment *\/ FROM\n-- SELECT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)\nSELECT DISTINCT * FROM\nSELECT DISTINCT *FROM\nSELECT DISTINCT a.* FROM\nSELECT DISTINCT a.*,b.* FROM\nSELECT DISTINCT a.*, b.* FROM\nSELECT DISTINCT a.*, \/* with a comment *\/ b.* FROM\nSELECT DISTINCT a.*,\/* with a comment *\/b.* FROM\nSELECT DISTINCT a.* \/* comment *\/ FROM\n-- SELECT DISTINCT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)\nSELECT `*` FROM table_name\nSELECT `*`.* FROM table_name AS `*`\nSELECT COUNT(*) FROM table_name\nSELECT COUNT( * ) FROM table_name\nSELECT COUNT( * \/* comment with *,USING,FROM *\/) FROM table_name\nSELECT COUNT(`*`) FROM table_name\nSELECT 1 FROM table_name WHERE LABEL LIKE '%*%'\nDELETE a.* USING\nDELETE a.*, b.* USING\nDELETE a.* ,b.* USING\nDELETE a.* , b.* USING\nDELETE a.* \/* comment *\/ USING\nDELETE a.* \/* comment *\/, b.* \/*comment*\/ USING\nDELETE a.* \/* comment *\/ ,b.* \/*comment*\/ USING\nDELETE a.* \/* comment *\/ , b.* \/*comment*\/ USING\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM\nSELECT *FROM\nSELECT a.* FROM\nSELECT a.*,b.* FROM\nSELECT a.*, b.* FROM\nSELECT a.*, \/* with a comment *\/ b.* FROM\nSELECT a.*,\/* with a comment *\/b.* FROM\nSELECT a.* \/* comment *\/ FROM\n-- SELECT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)\nSELECT DISTINCT * FROM\nSELECT DISTINCT *FROM\nSELECT DISTINCT a.* FROM\nSELECT DISTINCT a.*,b.* FROM\nSELECT DISTINCT a.*, b.* FROM\nSELECT DISTINCT a.*, \/* with a comment *\/ b.* FROM\nSELECT DISTINCT a.*,\/* with a comment *\/b.* FROM\nSELECT DISTINCT a.* \/* comment *\/ FROM\n-- SELECT DISTINCT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)\nSELECT `*` FROM table_name\nSELECT `*`.* FROM table_name AS `*`\nSELECT COUNT(*) FROM table_name\nSELECT COUNT( * ) FROM table_name\nSELECT COUNT( * \/* comment with *,USING,FROM *\/) FROM table_name\nSELECT COUNT(`*`) FROM table_name\nSELECT 1 FROM table_name WHERE LABEL LIKE '%*%'\nDELETE a.* USING\nDELETE a.*, b.* USING\nDELETE a.* ,b.* USING\nDELETE a.* , b.* USING\nDELETE a.* \/* comment *\/ USING\nDELETE a.* \/* comment *\/, b.* \/*comment*\/ USING\nDELETE a.* \/* comment *\/ ,b.* \/*comment*\/ USING\nDELETE a.* \/* comment *\/ , b.* \/*comment*\/ USING\n\n", + "len": 1348, + "last": 1348, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* with a comment *\/", + "value": "\/* with a comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* with a comment *\/", + "value": "\/* with a comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 191 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- SELECT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)", + "value": "-- SELECT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)", + "keyword": null, + "type": 4, + "flags": 4, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 364 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 365 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 371 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 372 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 380 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 381 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 382 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 383 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 387 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 388 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 394 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 395 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 403 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 404 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 405 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 409 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 410 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 416 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 417 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 425 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 426 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 427 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 428 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 429 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 430 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 434 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 435 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 441 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 442 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 450 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 451 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 452 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 453 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 454 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 455 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 456 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 457 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 458 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 459 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 463 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 464 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 470 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 471 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 479 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 480 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 481 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 482 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 483 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 484 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 485 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 486 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 487 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 488 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 489 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 493 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 494 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 500 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 501 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 509 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 510 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 511 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 512 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 513 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 514 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* with a comment *\/", + "value": "\/* with a comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 515 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 535 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 536 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 537 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 538 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 539 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 540 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 544 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 545 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 551 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 552 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 560 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 561 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 562 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 563 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 564 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* with a comment *\/", + "value": "\/* with a comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 565 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 585 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 586 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 587 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 588 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 589 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 593 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 594 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 600 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 601 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 609 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 610 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 611 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 612 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 613 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 614 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 627 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 628 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 632 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- SELECT DISTINCT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)", + "value": "-- SELECT DISTINCT a.*\/* comment *\/ FROM (This one is not working yet because of https:\/\/github.com\/phpmyadmin\/sql-parser\/issues\/285. Please uncomment when this issue is fixed.)", + "keyword": null, + "type": 4, + "flags": 4, + "position": 633 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 810 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 811 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 817 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 818 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 821 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 822 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 826 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 827 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 837 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 838 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 844 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 845 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 848 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 849 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 850 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 851 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 855 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 856 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 866 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 867 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 869 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 870 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 873 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 874 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 880 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 881 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 886 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 887 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 888 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 889 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 890 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 894 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 895 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 905 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 906 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 912 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 913 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 918 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 919 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 920 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 921 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 922 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 923 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 924 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 928 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 929 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 939 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 940 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 946 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 947 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 952 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 953 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 954 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 955 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment with *,USING,FROM *\/", + "value": "\/* comment with *,USING,FROM *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 956 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 987 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 988 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 989 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 993 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 994 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1004 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1005 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1011 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COUNT", + "value": "COUNT", + "keyword": "COUNT", + "type": 1, + "flags": 33, + "position": 1012 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1017 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 1018 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1021 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1022 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1023 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1027 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 1028 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1038 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1039 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1045 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 1046 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1047 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 1048 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1052 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table_name", + "value": "table_name", + "keyword": "TABLE_NAME", + "type": 1, + "flags": 1, + "position": 1053 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1063 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 1064 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1069 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LABEL", + "value": "LABEL", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1070 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1075 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIKE", + "value": "LIKE", + "keyword": "LIKE", + "type": 1, + "flags": 3, + "position": 1076 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1080 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'%*%'", + "value": "%*%", + "keyword": null, + "type": 7, + "flags": 1, + "position": 1081 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1086 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1087 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1093 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1094 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1095 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1096 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1097 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1098 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1208 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1209 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1213 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1226 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1227 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1228 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1229 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1230 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1231 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*comment*\/", + "value": "\/*comment*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1243 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1249 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1250 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1256 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1257 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1258 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1259 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1260 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1261 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1274 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1275 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1276 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1277 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1278 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1279 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*comment*\/", + "value": "\/*comment*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1280 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1291 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1292 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1297 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 1298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1304 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1305 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1306 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1307 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1308 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1309 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1322 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1323 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1324 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 1325 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1326 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 1327 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1328 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*comment*\/", + "value": "\/*comment*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 1329 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1340 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 1341 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 1346 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 382, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexString.out b/tests/data/lexer/lexString.out index 6774cd5af..ef595a3f9 100644 --- a/tests/data/lexer/lexString.out +++ b/tests/data/lexer/lexString.out @@ -1 +1,129 @@ -a:4:{s:5:"query";s:32:"SELECT 'foo', "bar", "foo\\ bar"";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:32:"SELECT 'foo', "bar", "foo\\ bar"";s:3:"len";i:32;s:4:"last";i:32;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'foo'";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""bar"";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:""foo\\ bar"";s:5:"value";s:8:"foo\ bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 'foo', \"bar\", \"foo\\\\ bar\"", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 'foo', \"bar\", \"foo\\\\ bar\"", + "len": 32, + "last": 32, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'foo'", + "value": "foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"bar\"", + "value": "bar", + "keyword": null, + "type": 7, + "flags": 2, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"foo\\\\ bar\"", + "value": "foo\\ bar", + "keyword": null, + "type": 7, + "flags": 2, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexStringErr1.out b/tests/data/lexer/lexStringErr1.out index 90433e40a..a3086d5de 100644 --- a/tests/data/lexer/lexStringErr1.out +++ b/tests/data/lexer/lexStringErr1.out @@ -1 +1,136 @@ -a:4:{s:5:"query";s:31:"SELECT 'foo', "bar", "foo\\ bar";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:31:"SELECT 'foo', "bar", "foo\\ bar";s:3:"len";i:31;s:4:"last";i:32;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'foo'";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""bar"";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:""foo\\ bar";s:5:"value";s:7:"foo\ ba";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:28:"Ending quote " was expected.";i:1;s:0:"";i:2;i:31;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 'foo', \"bar\", \"foo\\\\ bar", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 'foo', \"bar\", \"foo\\\\ bar", + "len": 31, + "last": 32, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'foo'", + "value": "foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"bar\"", + "value": "bar", + "keyword": null, + "type": 7, + "flags": 2, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"foo\\\\ bar", + "value": "foo\\ ba", + "keyword": null, + "type": 7, + "flags": 2, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Ending quote \" was expected.", + "", + 31, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexSymbol.out b/tests/data/lexer/lexSymbol.out index 065c4d6c1..5622cbace 100644 --- a/tests/data/lexer/lexSymbol.out +++ b/tests/data/lexer/lexSymbol.out @@ -1,4 +1,237 @@ -a:4:{s:5:"query";s:54:"SET @idx := 1; -SELECT @idx, @`idx`, @'idx', @@hostname";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:54:"SET @idx := 1; -SELECT @idx, @`idx`, @'idx', @@hostname";s:3:"len";i:54;s:4:"last";i:54;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:22:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:":=";s:5:"value";s:2:":=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:8;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:12;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:13;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:22;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"@`idx`";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"@'idx'";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"@@hostname";s:5:"value";s:8:"hostname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:9;s:8:"position";i:44;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:22;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET @idx := 1;\nSELECT @idx, @`idx`, @'idx', @@hostname", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET @idx := 1;\nSELECT @idx, @`idx`, @'idx', @@hostname", + "len": 54, + "last": 54, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":=", + "value": ":=", + "keyword": null, + "type": 2, + "flags": 8, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@`idx`", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@'idx'", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@@hostname", + "value": "hostname", + "keyword": null, + "type": 8, + "flags": 9, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 22, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexSymbolErr1.out b/tests/data/lexer/lexSymbolErr1.out index 190deb964..ad595a7f0 100644 --- a/tests/data/lexer/lexSymbolErr1.out +++ b/tests/data/lexer/lexSymbolErr1.out @@ -1,4 +1,217 @@ -a:4:{s:5:"query";s:41:"SET @idx := 1; -SELECT @idx, @`idx`, @'idx";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:41:"SET @idx := 1; -SELECT @idx, @`idx`, @'idx";s:3:"len";i:41;s:4:"last";i:42;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:19:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:":=";s:5:"value";s:2:":=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:8;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:12;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:13;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:22;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"@`idx`";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"@'idx";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:19;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:28:"Ending quote ' was expected.";i:1;s:0:"";i:2;i:41;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET @idx := 1;\nSELECT @idx, @`idx`, @'idx", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET @idx := 1;\nSELECT @idx, @`idx`, @'idx", + "len": 41, + "last": 42, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":=", + "value": ":=", + "keyword": null, + "type": 2, + "flags": 8, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@`idx`", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@'idx", + "value": "id", + "keyword": null, + "type": 8, + "flags": 1, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 19, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Ending quote ' was expected.", + "", + 41, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexSymbolErr2.out b/tests/data/lexer/lexSymbolErr2.out index 3b7186350..f4a62acfb 100644 --- a/tests/data/lexer/lexSymbolErr2.out +++ b/tests/data/lexer/lexSymbolErr2.out @@ -1,4 +1,217 @@ -a:4:{s:5:"query";s:38:"SET @idx := 1; -SELECT @idx, @`idx`, @ ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:38:"SET @idx := 1; -SELECT @idx, @`idx`, @ ";s:3:"len";i:38;s:4:"last";i:38;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:19:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:":=";s:5:"value";s:2:":=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:8;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:12;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:13;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:22;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"@`idx`";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"@";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:19;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:27:"Variable name was expected.";i:1;s:1:" ";i:2;i:37;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET @idx := 1;\nSELECT @idx, @`idx`, @ ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET @idx := 1;\nSELECT @idx, @`idx`, @ ", + "len": 38, + "last": 38, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":=", + "value": ":=", + "keyword": null, + "type": 2, + "flags": 8, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@`idx`", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@", + "value": "", + "keyword": null, + "type": 8, + "flags": 1, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 19, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Variable name was expected.", + " ", + 37, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexSymbolErr3.out b/tests/data/lexer/lexSymbolErr3.out index 810fd372a..c11efeab6 100644 --- a/tests/data/lexer/lexSymbolErr3.out +++ b/tests/data/lexer/lexSymbolErr3.out @@ -1 +1,82 @@ -a:4:{s:5:"query";s:11:"SELECT `idx";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:11:"SELECT `idx";s:3:"len";i:11;s:4:"last";i:12;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:4:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`idx";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:4;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:28:"Ending quote ` was expected.";i:1;s:0:"";i:2;i:11;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT `idx", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT `idx", + "len": 11, + "last": 12, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`idx", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 4, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [ + [ + "Ending quote ` was expected.", + "", + 11, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexSymbolUser.out b/tests/data/lexer/lexSymbolUser.out index bf181091a..102d20659 100644 --- a/tests/data/lexer/lexSymbolUser.out +++ b/tests/data/lexer/lexSymbolUser.out @@ -1 +1,156 @@ -a:4:{s:5:"query";s:55:"CREATE USER 'user'@'hostname' IDENTIFIED BY 'password';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:55:"CREATE USER 'user'@'hostname' IDENTIFIED BY 'password';";s:3:"len";i:55;s:4:"last";i:55;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"USER";s:5:"value";s:4:"USER";s:7:"keyword";s:4:"USER";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'user'@'hostname'";s:5:"value";s:13:"user@hostname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:4;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"IDENTIFIED";s:5:"value";s:10:"IDENTIFIED";s:7:"keyword";s:10:"IDENTIFIED";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:30;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"BY";s:5:"value";s:2:"BY";s:7:"keyword";s:2:"BY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:41;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"'password'";s:5:"value";s:8:"password";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:54;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE USER 'user'@'hostname' IDENTIFIED BY 'password';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE USER 'user'@'hostname' IDENTIFIED BY 'password';", + "len": 55, + "last": 55, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USER", + "value": "USER", + "keyword": "USER", + "type": 1, + "flags": 33, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'user'@'hostname'", + "value": "user@hostname", + "keyword": null, + "type": 8, + "flags": 4, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IDENTIFIED", + "value": "IDENTIFIED", + "keyword": "IDENTIFIED", + "type": 1, + "flags": 1, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BY", + "value": "BY", + "keyword": "BY", + "type": 1, + "flags": 3, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'password'", + "value": "password", + "keyword": null, + "type": 7, + "flags": 1, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexUtf8.out b/tests/data/lexer/lexUtf8.out index 1c20c85ae..bac93b768 100644 --- a/tests/data/lexer/lexUtf8.out +++ b/tests/data/lexer/lexUtf8.out @@ -1 +1,118 @@ -a:4:{s:5:"query";s:20:"select * from école";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";O:30:"PhpMyAdmin\SqlParser\UtfString":5:{s:3:"str";s:20:"select * from école";s:7:"byteIdx";i:19;s:7:"charIdx";i:18;s:7:"byteLen";i:20;s:7:"charLen";i:19;}s:3:"len";i:19;s:4:"last";i:19;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"école";s:5:"value";s:6:"école";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select * from école", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": { + "@type": "PhpMyAdmin\\SqlParser\\UtfString", + "str": "select * from école", + "byteIdx": 19, + "charIdx": 18, + "byteLen": 20, + "charLen": 19 + }, + "len": 19, + "last": 19, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "école", + "value": "école", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexWhitespace.out b/tests/data/lexer/lexWhitespace.out index ee4bc9012..3d58df126 100644 --- a/tests/data/lexer/lexWhitespace.out +++ b/tests/data/lexer/lexWhitespace.out @@ -1,28 +1,93 @@ -a:4:{s:5:"query";s:79:" - - -SELECT - 'w h i t e s p a c e' - - - - - ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:79:" - - -SELECT - 'w h i t e s p a c e' - - - - - ";s:3:"len";i:79;s:4:"last";i:79;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:22:"'w h i t e s p a c e'";s:5:"value";s:20:"w h i t e s p a c e";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:18;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:39:" - - - - - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "\n\n\nSELECT \n\t\t'w h i t e\t\ts p a c e'\n\n\t\t\n\t\t\t\n \n ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "\n\n\nSELECT \n\t\t'w h i t e\t\ts p a c e'\n\n\t\t\n\t\t\t\n \n ", + "len": 79, + "last": 79, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " \n\t\t", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'w h i t e\t\ts p a c e'", + "value": "w h i t e\t\ts p a c e", + "keyword": null, + "type": 7, + "flags": 1, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n\t\t\n\t\t\t\n \n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/lexer/lexWildcardThenComment.out b/tests/data/lexer/lexWildcardThenComment.out index 0b70e94ba..7682d555b 100644 --- a/tests/data/lexer/lexWildcardThenComment.out +++ b/tests/data/lexer/lexWildcardThenComment.out @@ -1,104 +1,1020 @@ -a:4:{s:5:"query";s:495:"SELECT */* comment */ - -SELECT /* comment */* - -SELECT 2*/* comment */3 - -SELECT 2/* comment */*3 - -SELECT */* -comment -on -multiple -lines -*/FROM - -DELETE foo.*/* foo */ USING - -DELETE foo.*/* foo */,bar.*/*bar*/ USING - -SELECT `*`/*with comment*/ AS star_field - -SELECT `*`,*/*with comment*/ - -DELETE a.*/*multi -line /* with C open tag -comment inside */ USING - -SELECT 2*/* operator */3 + 3/* operator */*2,/* start wildcard */*/* end wildcard */ - -SELECT `*`/*a*/*/*b*/`*` - --- invalid queries -/* SELECT */*";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:495:"SELECT */* comment */ - -SELECT /* comment */* - -SELECT 2*/* comment */3 - -SELECT 2/* comment */*3 - -SELECT */* -comment -on -multiple -lines -*/FROM - -DELETE foo.*/* foo */ USING - -DELETE foo.*/* foo */,bar.*/*bar*/ USING - -SELECT `*`/*with comment*/ AS star_field - -SELECT `*`,*/*with comment*/ - -DELETE a.*/*multi -line /* with C open tag -comment inside */ USING - -SELECT 2*/* operator */3 + 3/* operator */*2,/* start wildcard */*/* end wildcard */ - -SELECT `*`/*a*/*/*b*/`*` - --- invalid queries -/* SELECT */*";s:3:"len";i:495;s:4:"last";i:495;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:109:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:43;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:46;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:53;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:54;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:55;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:68;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:78;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:79;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:92;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:93;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:94;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:103;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:31:"/* -comment -on -multiple -lines -*/";s:5:"value";s:31:"/* -comment -on -multiple -lines -*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:104;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:135;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:141;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:148;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:151;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:152;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"/* foo */";s:5:"value";s:9:"/* foo */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:153;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:162;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:163;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:168;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:170;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:177;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:180;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:181;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"/* foo */";s:5:"value";s:9:"/* foo */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:182;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:191;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:192;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:195;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:196;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"/*bar*/";s:5:"value";s:7:"/*bar*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:197;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:204;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:205;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:210;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:212;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:218;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:219;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"/*with comment*/";s:5:"value";s:16:"/*with comment*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:222;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:238;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:239;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:241;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"star_field";s:5:"value";s:10:"star_field";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:242;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:252;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:254;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:260;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:261;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:264;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:265;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"/*with comment*/";s:5:"value";s:16:"/*with comment*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:266;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:282;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:284;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:290;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:291;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:292;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:293;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:49:"/*multi -line /* with C open tag -comment inside */";s:5:"value";s:49:"/*multi -line /* with C open tag -comment inside */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:294;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:343;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:344;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:349;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:351;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:357;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:358;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:359;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"/* operator */";s:5:"value";s:14:"/* operator */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:360;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:374;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:375;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:376;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:377;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:378;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"/* operator */";s:5:"value";s:14:"/* operator */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:379;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:393;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:394;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:395;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"/* start wildcard */";s:5:"value";s:20:"/* start wildcard */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:396;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:416;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"/* end wildcard */";s:5:"value";s:18:"/* end wildcard */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:417;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:435;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:437;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:443;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:444;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/*a*/";s:5:"value";s:5:"/*a*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:447;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:452;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/*b*/";s:5:"value";s:5:"/*b*/";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:453;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`*`";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:458;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:461;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"-- invalid queries";s:5:"value";s:18:"-- invalid queries";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:463;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:481;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"/* SELECT */";s:5:"value";s:12:"/* SELECT */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:482;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:494;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:109;s:3:"idx";i:0;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";N;s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT *\/* comment *\/\n\nSELECT \/* comment *\/*\n\nSELECT 2*\/* comment *\/3\n\nSELECT 2\/* comment *\/*3\n\nSELECT *\/*\ncomment\non\nmultiple\nlines\n*\/FROM\n\nDELETE foo.*\/* foo *\/ USING\n\nDELETE foo.*\/* foo *\/,bar.*\/*bar*\/ USING\n\nSELECT `*`\/*with comment*\/ AS star_field\n\nSELECT `*`,*\/*with comment*\/\n\nDELETE a.*\/*multi\nline \/* with C open tag\ncomment inside *\/ USING\n\nSELECT 2*\/* operator *\/3 + 3\/* operator *\/*2,\/* start wildcard *\/*\/* end wildcard *\/\n\nSELECT `*`\/*a*\/*\/*b*\/`*`\n\n-- invalid queries\n\/* SELECT *\/*", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT *\/* comment *\/\n\nSELECT \/* comment *\/*\n\nSELECT 2*\/* comment *\/3\n\nSELECT 2\/* comment *\/*3\n\nSELECT *\/*\ncomment\non\nmultiple\nlines\n*\/FROM\n\nDELETE foo.*\/* foo *\/ USING\n\nDELETE foo.*\/* foo *\/,bar.*\/*bar*\/ USING\n\nSELECT `*`\/*with comment*\/ AS star_field\n\nSELECT `*`,*\/*with comment*\/\n\nDELETE a.*\/*multi\nline \/* with C open tag\ncomment inside *\/ USING\n\nSELECT 2*\/* operator *\/3 + 3\/* operator *\/*2,\/* start wildcard *\/*\/* end wildcard *\/\n\nSELECT `*`\/*a*\/*\/*b*\/`*`\n\n-- invalid queries\n\/* SELECT *\/*", + "len": 495, + "last": 495, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*\ncomment\non\nmultiple\nlines\n*\/", + "value": "\/*\ncomment\non\nmultiple\nlines\n*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* foo *\/", + "value": "\/* foo *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* foo *\/", + "value": "\/* foo *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 191 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 192 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*bar*\/", + "value": "\/*bar*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 204 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 205 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*with comment*\/", + "value": "\/*with comment*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 238 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 239 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "star_field", + "value": "star_field", + "keyword": null, + "type": 0, + "flags": 0, + "position": 242 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 260 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 261 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 264 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 265 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*with comment*\/", + "value": "\/*with comment*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 266 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 282 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 284 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 290 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 291 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 292 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 293 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*multi\nline \/* with C open tag\ncomment inside *\/", + "value": "\/*multi\nline \/* with C open tag\ncomment inside *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 294 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 343 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 344 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 349 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 351 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 357 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 358 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 359 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* operator *\/", + "value": "\/* operator *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 360 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 374 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 375 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 376 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 377 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 378 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* operator *\/", + "value": "\/* operator *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 379 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 393 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 394 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 395 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* start wildcard *\/", + "value": "\/* start wildcard *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 396 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 416 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* end wildcard *\/", + "value": "\/* end wildcard *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 417 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 435 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 437 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 443 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 444 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*a*\/", + "value": "\/*a*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 447 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 452 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/*b*\/", + "value": "\/*b*\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 453 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`*`", + "value": "*", + "keyword": null, + "type": 8, + "flags": 2, + "position": 458 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 461 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- invalid queries", + "value": "-- invalid queries", + "keyword": null, + "type": 4, + "flags": 4, + "position": 463 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 481 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* SELECT *\/", + "value": "\/* SELECT *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 482 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 494 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 109, + "idx": 0 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": null, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/misc/parseParameter.out b/tests/data/misc/parseParameter.out index 24a3dcea5..5cad6dd2c 100644 --- a/tests/data/misc/parseParameter.out +++ b/tests/data/misc/parseParameter.out @@ -1 +1,702 @@ -a:4:{s:5:"query";s:95:"INSERT INTO `person` (`firstname`, `lastname`, `email`) VALUES (:firstname, :lastname, :email);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:95:"INSERT INTO `person` (`firstname`, `lastname`, `email`) VALUES (:firstname, :lastname, :email);";s:3:"len";i:95;s:4:"last";i:95;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`person`";s:5:"value";s:6:"person";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`firstname`";s:5:"value";s:9:"firstname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`lastname`";s:5:"value";s:8:"lastname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:35;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:45;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`email`";s:5:"value";s:5:"email";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:56;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:":firstname";s:5:"value";s:9:"firstname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:16;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:74;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:":lastname";s:5:"value";s:8:"lastname";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:16;s:8:"position";i:76;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:85;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:":email";s:5:"value";s:5:"email";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:16;s:8:"position";i:87;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:93;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:94;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:29;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"person";s:6:"column";N;s:4:"expr";s:8:"`person`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:3:{i:0;s:9:"firstname";i:1;s:8:"lastname";i:2;s:5:"email";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:1:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:3:{i:0;s:10:":firstname";i:1;s:9:":lastname";i:2;s:6:":email";}s:6:"values";a:3:{i:0;s:9:"firstname";i:1;s:8:"lastname";i:2;s:5:"email";}}}s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:26;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO `person` (`firstname`, `lastname`, `email`) VALUES (:firstname, :lastname, :email);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `person` (`firstname`, `lastname`, `email`) VALUES (:firstname, :lastname, :email);", + "len": 95, + "last": 95, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`person`", + "value": "person", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`firstname`", + "value": "firstname", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`lastname`", + "value": "lastname", + "keyword": null, + "type": 8, + "flags": 2, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email`", + "value": "email", + "keyword": null, + "type": 8, + "flags": 2, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":firstname", + "value": "firstname", + "keyword": null, + "type": 8, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":lastname", + "value": "lastname", + "keyword": null, + "type": 8, + "flags": 16, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":email", + "value": "email", + "keyword": null, + "type": 8, + "flags": 16, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 29 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "person", + "column": null, + "expr": "`person`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "firstname", + "lastname", + "email" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + ":firstname", + ":lastname", + ":email" + ], + "values": [ + "firstname", + "lastname", + "email" + ] + } + ], + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 26 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parse.out b/tests/data/parser/parse.out index e0660b7a6..ce9ad3aaf 100644 --- a/tests/data/parser/parse.out +++ b/tests/data/parser/parse.out @@ -1 +1,584 @@ -a:4:{s:5:"query";s:9:"SELECT 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:9:"SELECT 1;";s:3:"len";i:9;s:4:"last";i:9;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:2;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 1;", + "len": 9, + "last": 9, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 2 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parse2.out b/tests/data/parser/parse2.out index cf5acf795..25e9f4620 100644 --- a/tests/data/parser/parse2.out +++ b/tests/data/parser/parse2.out @@ -1 +1,868 @@ -a:4:{s:5:"query";s:24:"(SELECT 1);((SELECT 2));";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:24:"(SELECT 1);((SELECT 2));";s:3:"len";i:24;s:4:"last";i:24;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:12;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:20;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:23;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:4;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:5;s:4:"last";i:12;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "(SELECT 1);((SELECT 2));", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "(SELECT 1);((SELECT 2));", + "len": 24, + "last": 24, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "2", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 5, + "last": 12 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter.out b/tests/data/parser/parseAlter.out index 646ea4e6c..64948f55e 100644 --- a/tests/data/parser/parseAlter.out +++ b/tests/data/parser/parseAlter.out @@ -1,7 +1,886 @@ -a:4:{s:5:"query";s:102:"ALTER TABLE `actor` - ADD PRIMARY KEY (`actor_id`), - ADD KEY `idx_actor_last_name` (`last_name`);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:102:"ALTER TABLE `actor` - ADD PRIMARY KEY (`actor_id`), - ADD KEY `idx_actor_last_name` (`last_name`);";s:3:"len";i:102;s:4:"last";i:102;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`actor`";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ADD";s:5:"value";s:3:"ADD";s:7:"keyword";s:3:"ADD";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:28;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ADD";s:5:"value";s:3:"ADD";s:7:"keyword";s:3:"ADD";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:58;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:62;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:21:"`idx_actor_last_name`";s:5:"value";s:19:"idx_actor_last_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:66;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`last_name`";s:5:"value";s:9:"last_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:89;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:100;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:101;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:26;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:7:"`actor`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:2:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:3:"ADD";i:2;s:11:"PRIMARY KEY";}}s:5:"field";N;s:7:"unknown";a:3:{i:0;r:79;i:1;r:86;i:2;r:93;}}i:1;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:3:"ADD";i:2;s:3:"KEY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:19:"idx_actor_last_name";s:4:"expr";s:21:"`idx_actor_last_name`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:3:{i:0;r:156;i:1;r:163;i:2;r:170;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:24;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE `actor`\n ADD PRIMARY KEY (`actor_id`),\n ADD KEY `idx_actor_last_name` (`last_name`);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `actor`\n ADD PRIMARY KEY (`actor_id`),\n ADD KEY `idx_actor_last_name` (`last_name`);", + "len": 102, + "last": 102, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor`", + "value": "actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ADD", + "value": "ADD", + "keyword": "ADD", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ADD", + "value": "ADD", + "keyword": "ADD", + "type": 1, + "flags": 3, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`idx_actor_last_name`", + "value": "idx_actor_last_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_name`", + "value": "last_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 26 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "`actor`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ADD", + "2": "PRIMARY KEY" + } + }, + "field": null, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ADD", + "2": "KEY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "idx_actor_last_name", + "expr": "`idx_actor_last_name`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 24 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter10.out b/tests/data/parser/parseAlter10.out index 20966ccc5..d183bf748 100644 --- a/tests/data/parser/parseAlter10.out +++ b/tests/data/parser/parseAlter10.out @@ -1 +1,747 @@ -a:4:{s:5:"query";s:81:"ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:81:"ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;";s:3:"len";i:81;s:4:"last";i:81;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:22:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`database`";s:5:"value";s:8:"database";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`table`";s:5:"value";s:5:"table";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`field`";s:5:"value";s:5:"field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:38;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:46;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:54;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:69;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:80;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:22;s:3:"idx";i:22;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:8:"database";s:5:"table";s:5:"table";s:6:"column";N;s:4:"expr";s:18:"`database`.`table`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"field";s:4:"expr";s:7:"`field`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:8:{i:0;r:93;i:1;r:100;i:2;r:107;i:3;r:114;i:4;r:121;i:5;r:128;i:6;r:135;i:7;r:142;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:20;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;", + "len": 81, + "last": 81, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`database`", + "value": "database", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`table`", + "value": "table", + "keyword": null, + "type": 8, + "flags": 2, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field`", + "value": "field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 22, + "idx": 22 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "database", + "table": "table", + "column": null, + "expr": "`database`.`table`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "field", + "expr": "`field`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 20 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter11.out b/tests/data/parser/parseAlter11.out index c515eee0f..af11cc94a 100644 --- a/tests/data/parser/parseAlter11.out +++ b/tests/data/parser/parseAlter11.out @@ -1 +1,1054 @@ -a:4:{s:5:"query";s:98:"ALTER TABLE `actor` ADD `last_update2` SET ('value1','value2','value3') NOT NULL AFTER last_update";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:98:"ALTER TABLE `actor` ADD `last_update2` SET ('value1','value2','value3') NOT NULL AFTER last_update";s:3:"len";i:98;s:4:"last";i:98;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`actor`";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ADD";s:5:"value";s:3:"ADD";s:7:"keyword";s:3:"ADD";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`last_update2`";s:5:"value";s:12:"last_update2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'value1'";s:5:"value";s:6:"value1";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:44;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'value2'";s:5:"value";s:6:"value2";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:53;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:61;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'value3'";s:5:"value";s:6:"value3";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:62;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:72;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"AFTER";s:5:"value";s:5:"AFTER";s:7:"keyword";s:5:"AFTER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:81;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"last_update";s:5:"value";s:11:"last_update";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:87;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:26;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:7:"`actor`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:3:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:3:"ADD";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:12:"last_update2";s:4:"expr";s:14:"`last_update2`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:0:{}}i:1;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"value2";s:4:"expr";s:8:"'value2'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:0:{}}i:2;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"value3";s:4:"expr";s:8:"'value3'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:7:{i:0;r:135;i:1;r:142;i:2;r:149;i:3;r:156;i:4;r:163;i:5;r:170;i:6;r:177;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:25;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:29:"Unrecognized alter operation.";i:1;r:121;i:2;i:0;}i:2;a:3:{i:0;s:29:"Unrecognized alter operation.";i:1;r:184;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "ALTER TABLE `actor` ADD `last_update2` SET ('value1','value2','value3') NOT NULL AFTER last_update", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `actor` ADD `last_update2` SET ('value1','value2','value3') NOT NULL AFTER last_update", + "len": 98, + "last": 98, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor`", + "value": "actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ADD", + "value": "ADD", + "keyword": "ADD", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_update2`", + "value": "last_update2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'value1'", + "value": "value1", + "keyword": null, + "type": 7, + "flags": 1, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'value2'", + "value": "value2", + "keyword": null, + "type": 7, + "flags": 1, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'value3'", + "value": "value3", + "keyword": null, + "type": 7, + "flags": 1, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AFTER", + "value": "AFTER", + "keyword": "AFTER", + "type": 1, + "flags": 1, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "last_update", + "value": "last_update", + "keyword": null, + "type": 0, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 26 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "`actor`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ADD" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "last_update2", + "expr": "`last_update2`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "value2", + "expr": "'value2'", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "value3", + "expr": "'value3'", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 25 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unrecognized alter operation.", + { + "@type": "@18" + }, + 0 + ], + [ + "Unrecognized alter operation.", + { + "@type": "@27" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter12.out b/tests/data/parser/parseAlter12.out index 858f38642..bdd0480ce 100644 --- a/tests/data/parser/parseAlter12.out +++ b/tests/data/parser/parseAlter12.out @@ -1 +1,685 @@ -a:4:{s:5:"query";s:58:"ALTER TABLE actor ALTER last_update2 SET DEFAULT 'value1';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:58:"ALTER TABLE actor ALTER last_update2 SET DEFAULT 'value1';";s:3:"len";i:58;s:4:"last";i:58;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"actor";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"last_update2";s:5:"value";s:12:"last_update2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:41;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'value1'";s:5:"value";s:6:"value1";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:57;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:5:"actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:5:"ALTER";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:12:"last_update2";s:4:"expr";s:12:"last_update2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:0:{}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "ALTER TABLE actor ALTER last_update2 SET DEFAULT 'value1';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE actor ALTER last_update2 SET DEFAULT 'value1';", + "len": 58, + "last": 58, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "actor", + "value": "actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "last_update2", + "value": "last_update2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'value1'", + "value": "value1", + "keyword": null, + "type": 7, + "flags": 1, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "actor", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ALTER" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "last_update2", + "expr": "last_update2", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter2.out b/tests/data/parser/parseAlter2.out index daf4ec070..0aa93ac81 100644 --- a/tests/data/parser/parseAlter2.out +++ b/tests/data/parser/parseAlter2.out @@ -1,4 +1,767 @@ -a:4:{s:5:"query";s:84:"ALTER /* */ TABLE /* */ table -CONVERT /* */ TO /* */ CHARACTER /* */ SET /* */ utf8;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:84:"ALTER /* */ TABLE /* */ table -CONVERT /* */ TO /* */ CHARACTER /* */ SET /* */ utf8;";s:3:"len";i:84;s:4:"last";i:84;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"table";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CONVERT";s:5:"value";s:7:"CONVERT";s:7:"keyword";s:7:"CONVERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:44;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"CHARACTER";s:5:"value";s:9:"CHARACTER";s:7:"keyword";s:9:"CHARACTER";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:53;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:63;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:69;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:73;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"utf8";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:79;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:83;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:29;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";N;s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:2:"TO";}}s:5:"field";N;s:7:"unknown";a:3:{i:0;r:135;i:1;r:142;i:2;r:156;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:3;s:5:"TABLE";i:12;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:27;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:35:"This option conflicts with "TABLE".";i:1;r:65;i:2;i:0;}i:1;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:163;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "ALTER \/* *\/ TABLE \/* *\/ table\nCONVERT \/* *\/ TO \/* *\/ CHARACTER \/* *\/ SET \/* *\/ utf8;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER \/* *\/ TABLE \/* *\/ table\nCONVERT \/* *\/ TO \/* *\/ CHARACTER \/* *\/ SET \/* *\/ utf8;", + "len": 84, + "last": 84, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONVERT", + "value": "CONVERT", + "keyword": "CONVERT", + "type": 1, + "flags": 35, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER", + "value": "CHARACTER", + "keyword": "CHARACTER", + "type": 1, + "flags": 11, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "utf8", + "value": "utf8", + "keyword": null, + "type": 0, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 29 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": null, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "TO" + } + }, + "field": null, + "unknown": [ + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@23" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE", + "12": "TABLE" + } + }, + "first": 0, + "last": 27 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This option conflicts with \"TABLE\".", + { + "@type": "@10" + }, + 0 + ], + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@24" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter3.out b/tests/data/parser/parseAlter3.out index c336533d6..b74534d40 100644 --- a/tests/data/parser/parseAlter3.out +++ b/tests/data/parser/parseAlter3.out @@ -1,7 +1,1010 @@ -a:4:{s:5:"query";s:153:"ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT - -ALTER TABLE `tbl` CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:153:"ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT - -ALTER TABLE `tbl` CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:3:"len";i:153;s:4:"last";i:153;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:48:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`tbl`";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:65;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`tbl`";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:93;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:99;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:105;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_1`";s:5:"value";s:7:"field_1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:106;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:115;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_2`";s:5:"value";s:7:"field_2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:116;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:126;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:129;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:131;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:134;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:136;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:144;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:145;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:48;s:3:"idx";i:48;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"tbl";s:6:"column";N;s:4:"expr";s:5:"`tbl`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"uid";s:4:"expr";s:5:"`uid`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:15:{i:0;r:79;i:1;r:86;i:2;r:93;i:3;r:100;i:4;r:107;i:5;r:114;i:6;r:121;i:7;r:128;i:8;r:135;i:9;r:142;i:10;r:149;i:11;r:156;i:12;r:163;i:13;r:170;i:14;r:177;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:184;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT\n\nALTER TABLE `tbl` CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT\n\nALTER TABLE `tbl` CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "len": 153, + "last": 153, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl`", + "value": "tbl", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl`", + "value": "tbl", + "keyword": null, + "type": 8, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_1`", + "value": "field_1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_2`", + "value": "field_2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 48, + "idx": 48 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl", + "column": null, + "expr": "`tbl`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "uid", + "expr": "`uid`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@27" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter4.out b/tests/data/parser/parseAlter4.out index 41a635c9b..0ad507346 100644 --- a/tests/data/parser/parseAlter4.out +++ b/tests/data/parser/parseAlter4.out @@ -1 +1,606 @@ -a:4:{s:5:"query";s:48:"ALTER TABLE my_table COMMENT='Comment of table';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:48:"ALTER TABLE my_table COMMENT='Comment of table';";s:3:"len";i:48;s:4:"last";i:48;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"my_table";s:5:"value";s:8:"my_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COMMENT";s:5:"value";s:7:"COMMENT";s:7:"keyword";s:7:"COMMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:28;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"'Comment of table'";s:5:"value";s:16:"Comment of table";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:29;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:47;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"my_table";s:6:"column";N;s:4:"expr";s:8:"my_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:7:"COMMENT";s:6:"equals";b:1;s:4:"expr";s:18:"'Comment of table'";s:5:"value";s:16:"Comment of table";}}}s:5:"field";N;s:7:"unknown";a:0:{}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE my_table COMMENT='Comment of table';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE my_table COMMENT='Comment of table';", + "len": 48, + "last": 48, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_table", + "value": "my_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COMMENT", + "value": "COMMENT", + "keyword": "COMMENT", + "type": 1, + "flags": 1, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Comment of table'", + "value": "Comment of table", + "keyword": null, + "type": 7, + "flags": 1, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "my_table", + "column": null, + "expr": "my_table", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "COMMENT", + "equals": true, + "expr": "'Comment of table'", + "value": "Comment of table" + } + } + }, + "field": null, + "unknown": [] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter5.out b/tests/data/parser/parseAlter5.out index 5d36504e1..2e06523ec 100644 --- a/tests/data/parser/parseAlter5.out +++ b/tests/data/parser/parseAlter5.out @@ -1 +1,615 @@ -a:4:{s:5:"query";s:43:"ALTER DATABASE `abc` CHARACTER SET = 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"ALTER DATABASE `abc` CHARACTER SET = 'utf8'";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:12:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DATABASE";s:5:"value";s:8:"DATABASE";s:7:"keyword";s:8:"DATABASE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`abc`";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:15;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:12;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"abc";s:6:"column";N;s:4:"expr";s:5:"`abc`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:13:"CHARACTER SET";s:6:"equals";b:1;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:5:"field";N;s:7:"unknown";a:0:{}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:8:"DATABASE";}}s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER DATABASE `abc` CHARACTER SET = 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER DATABASE `abc` CHARACTER SET = 'utf8'", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATABASE", + "value": "DATABASE", + "keyword": "DATABASE", + "type": 1, + "flags": 35, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`abc`", + "value": "abc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 12, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "abc", + "column": null, + "expr": "`abc`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "CHARACTER SET", + "equals": true, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "field": null, + "unknown": [] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "DATABASE" + } + }, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter6.out b/tests/data/parser/parseAlter6.out index c78455a31..40746b81a 100644 --- a/tests/data/parser/parseAlter6.out +++ b/tests/data/parser/parseAlter6.out @@ -1 +1,671 @@ -a:4:{s:5:"query";s:39:"ALTER VIEW `abc` AS SELECT `a` FROM `b`";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:39:"ALTER VIEW `abc` AS SELECT `a` FROM `b`";s:3:"len";i:39;s:4:"last";i:39;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`abc`";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`b`";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:36;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:16;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"abc";s:6:"column";N;s:4:"expr";s:5:"`abc`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:2:"AS";}}s:5:"field";N;s:7:"unknown";a:8:{i:0;r:58;i:1;r:65;i:2;r:72;i:3;r:79;i:4;r:86;i:5;r:93;i:6;r:100;i:7;r:107;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER VIEW `abc` AS SELECT `a` FROM `b`", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER VIEW `abc` AS SELECT `a` FROM `b`", + "len": 39, + "last": 39, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`abc`", + "value": "abc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`b`", + "value": "b", + "keyword": null, + "type": 8, + "flags": 2, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 16 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "abc", + "column": null, + "expr": "`abc`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "AS" + } + }, + "field": null, + "unknown": [ + { + "@type": "@9" + }, + { + "@type": "@10" + }, + { + "@type": "@11" + }, + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "VIEW" + } + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter7.out b/tests/data/parser/parseAlter7.out index 3dcd6f012..d6b50f6a3 100644 --- a/tests/data/parser/parseAlter7.out +++ b/tests/data/parser/parseAlter7.out @@ -1 +1,1119 @@ -a:4:{s:5:"query";s:135:"ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:135:"ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:3:"len";i:135;s:4:"last";i:135;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:43:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`tbl`";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:65;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:79;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_1`";s:5:"value";s:7:"field_1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:88;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_2`";s:5:"value";s:7:"field_2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:98;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:108;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:111;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:113;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:115;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:116;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:117;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:118;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:127;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:43;s:3:"idx";i:43;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"tbl";s:6:"column";N;s:4:"expr";s:5:"`tbl`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:2:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"uid";s:4:"expr";s:5:"`uid`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:14:{i:0;r:79;i:1;r:86;i:2;r:93;i:3;r:100;i:4;r:107;i:5;r:114;i:6;r:121;i:7;r:128;i:8;r:135;i:9;r:142;i:10;r:149;i:11;r:156;i:12;r:163;i:13;r:170;}}i:1;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:7:"field_1";s:4:"expr";s:9:"`field_1`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:12:{i:0;r:219;i:1;r:226;i:2;r:233;i:3;r:240;i:4;r:247;i:5;r:254;i:6;r:261;i:7;r:268;i:8;r:275;i:9;r:282;i:10;r:289;i:11;r:296;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:42;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "len": 135, + "last": 135, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl`", + "value": "tbl", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_1`", + "value": "field_1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_2`", + "value": "field_2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 43, + "idx": 43 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl", + "column": null, + "expr": "`tbl`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "uid", + "expr": "`uid`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "field_1", + "expr": "`field_1`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + }, + { + "@type": "@35" + }, + { + "@type": "@36" + }, + { + "@type": "@37" + }, + { + "@type": "@38" + }, + { + "@type": "@39" + }, + { + "@type": "@40" + }, + { + "@type": "@41" + }, + { + "@type": "@42" + }, + { + "@type": "@43" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 42 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter8.out b/tests/data/parser/parseAlter8.out index 8766a08ab..57de62ed9 100644 --- a/tests/data/parser/parseAlter8.out +++ b/tests/data/parser/parseAlter8.out @@ -1 +1,777 @@ -a:4:{s:5:"query";s:82:"ALTER TABLE `api_tab_user` CHANGE `rank_id` `rank_id` INT(4) NOT NULL DEFAULT '4';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:82:"ALTER TABLE `api_tab_user` CHANGE `rank_id` `rank_id` INT(4) NOT NULL DEFAULT '4';";s:3:"len";i:82;s:4:"last";i:82;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`api_tab_user`";s:5:"value";s:12:"api_tab_user";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`rank_id`";s:5:"value";s:7:"rank_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`rank_id`";s:5:"value";s:7:"rank_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:54;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"4";s:5:"value";i:4;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:58;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:59;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:61;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'4'";s:5:"value";s:1:"4";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:78;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:81;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:12:"api_tab_user";s:6:"column";N;s:4:"expr";s:14:"`api_tab_user`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:7:"rank_id";s:4:"expr";s:9:"`rank_id`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:12:{i:0;r:79;i:1;r:86;i:2;r:93;i:3;r:100;i:4;r:107;i:5;r:114;i:6;r:121;i:7;r:128;i:8;r:135;i:9;r:142;i:10;r:149;i:11;r:156;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:22;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE `api_tab_user` CHANGE `rank_id` `rank_id` INT(4) NOT NULL DEFAULT '4';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE `api_tab_user` CHANGE `rank_id` `rank_id` INT(4) NOT NULL DEFAULT '4';", + "len": 82, + "last": 82, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`api_tab_user`", + "value": "api_tab_user", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rank_id`", + "value": "rank_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rank_id`", + "value": "rank_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "4", + "value": 4, + "keyword": null, + "type": 6, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'4'", + "value": "4", + "keyword": null, + "type": 7, + "flags": 1, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "api_tab_user", + "column": null, + "expr": "`api_tab_user`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "rank_id", + "expr": "`rank_id`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 22 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlter9.out b/tests/data/parser/parseAlter9.out index f59e4ff40..78bb3dbe4 100644 --- a/tests/data/parser/parseAlter9.out +++ b/tests/data/parser/parseAlter9.out @@ -1 +1,844 @@ -a:4:{s:5:"query";s:142:"ALTER TABLE place CHANGE COLUMN plc_location_type gplc_location_type ENUM('LOCATION') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:142:"ALTER TABLE place CHANGE COLUMN plc_location_type gplc_location_type ENUM('LOCATION') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL;";s:3:"len";i:142;s:4:"last";i:142;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:30:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"place";s:5:"value";s:5:"place";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"COLUMN";s:5:"value";s:6:"COLUMN";s:7:"keyword";s:6:"COLUMN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"plc_location_type";s:5:"value";s:17:"plc_location_type";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"gplc_location_type";s:5:"value";s:18:"gplc_location_type";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"ENUM";s:5:"value";s:4:"ENUM";s:7:"keyword";s:4:"ENUM";s:4:"type";i:1;s:5:"flags";i:9;s:8:"position";i:69;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"'LOCATION'";s:5:"value";s:8:"LOCATION";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:74;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:84;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:86;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:100;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLLATE";s:5:"value";s:7:"COLLATE";s:7:"keyword";s:7:"COLLATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:107;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'utf8_unicode_ci'";s:5:"value";s:15:"utf8_unicode_ci";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:115;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:133;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:141;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:30;s:3:"idx";i:30;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"place";s:6:"column";N;s:4:"expr";s:5:"place";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:6:"CHANGE";i:2;s:6:"COLUMN";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:17:"plc_location_type";s:4:"expr";s:17:"plc_location_type";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:16:{i:0;r:93;i:1;r:100;i:2;r:107;i:3;r:114;i:4;r:121;i:5;r:128;i:6;r:135;i:7;r:142;i:8;r:149;i:9;r:156;i:10;r:163;i:11;r:170;i:12;r:177;i:13;r:184;i:14;r:191;i:15;r:198;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:28;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE place CHANGE COLUMN plc_location_type gplc_location_type ENUM('LOCATION') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE place CHANGE COLUMN plc_location_type gplc_location_type ENUM('LOCATION') CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL;", + "len": 142, + "last": 142, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "place", + "value": "place", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMN", + "value": "COLUMN", + "keyword": "COLUMN", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "plc_location_type", + "value": "plc_location_type", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "gplc_location_type", + "value": "gplc_location_type", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENUM", + "value": "ENUM", + "keyword": "ENUM", + "type": 1, + "flags": 9, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'LOCATION'", + "value": "LOCATION", + "keyword": null, + "type": 7, + "flags": 1, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLLATE", + "value": "COLLATE", + "keyword": "COLLATE", + "type": 1, + "flags": 3, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8_unicode_ci'", + "value": "utf8_unicode_ci", + "keyword": null, + "type": 7, + "flags": 1, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 30, + "idx": 30 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "place", + "column": null, + "expr": "place", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE", + "2": "COLUMN" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "plc_location_type", + "expr": "plc_location_type", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 28 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlterErr.out b/tests/data/parser/parseAlterErr.out index 060e5af74..c4511e7c2 100644 --- a/tests/data/parser/parseAlterErr.out +++ b/tests/data/parser/parseAlterErr.out @@ -1,4 +1,974 @@ -a:4:{s:5:"query";s:176:"-- missing comma between alter operations -ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:176:"-- missing comma between alter operations -ALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL";s:3:"len";i:176;s:4:"last";i:176;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:44:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:41:"-- missing comma between alter operations";s:5:"value";s:41:"-- missing comma between alter operations";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`tbl`";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:54;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:60;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:67;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`uid`";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:73;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:79;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:82;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:83;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:84;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:87;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:98;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:107;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:121;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:122;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:128;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_1`";s:5:"value";s:7:"field_1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:129;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:138;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`field_2`";s:5:"value";s:7:"field_2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:139;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:149;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:152;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:153;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:154;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:156;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:157;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"UNSIGNED";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:159;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:167;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:168;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:44;s:3:"idx";i:44;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"tbl";s:6:"column";N;s:4:"expr";s:5:"`tbl`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"uid";s:4:"expr";s:5:"`uid`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:15:{i:0;r:93;i:1;r:100;i:2;r:107;i:3;r:114;i:4;r:121;i:5;r:128;i:6;r:135;i:7;r:142;i:8;r:149;i:9;r:156;i:10;r:163;i:11;r:170;i:12;r:177;i:13;r:184;i:14;r:191;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:43;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:52:"Missing comma before start of a new alter operation.";i:1;r:198;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- missing comma between alter operations\nALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- missing comma between alter operations\nALTER TABLE `tbl` CHANGE `uid` `uid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT CHANGE `field_1` `field_2` INT( 10 ) UNSIGNED NOT NULL", + "len": 176, + "last": 176, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- missing comma between alter operations", + "value": "-- missing comma between alter operations", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl`", + "value": "tbl", + "keyword": null, + "type": 8, + "flags": 2, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`uid`", + "value": "uid", + "keyword": null, + "type": 8, + "flags": 2, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_1`", + "value": "field_1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field_2`", + "value": "field_2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNSIGNED", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 44, + "idx": 44 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl", + "column": null, + "expr": "`tbl`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "uid", + "expr": "`uid`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 43 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Missing comma before start of a new alter operation.", + { + "@type": "@29" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlterErr2.out b/tests/data/parser/parseAlterErr2.out index ea03efbb6..3c42f6d1d 100644 --- a/tests/data/parser/parseAlterErr2.out +++ b/tests/data/parser/parseAlterErr2.out @@ -1,7 +1,905 @@ -a:4:{s:5:"query";s:148:"-- missing comma between alter operations -ALTER TABLE tb_foo CHANGE inmsg inmsg date NULL AFTER outmsg2 CHANGE inmsg2 inmsg2 time NULL AFTER inmsg; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:148:"-- missing comma between alter operations -ALTER TABLE tb_foo CHANGE inmsg inmsg date NULL AFTER outmsg2 CHANGE inmsg2 inmsg2 time NULL AFTER inmsg; -";s:3:"len";i:148;s:4:"last";i:148;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:38:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:41:"-- missing comma between alter operations";s:5:"value";s:41:"-- missing comma between alter operations";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"tb_foo";s:5:"value";s:6:"tb_foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:54;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:61;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"inmsg";s:5:"value";s:5:"inmsg";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:68;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"inmsg";s:5:"value";s:5:"inmsg";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:74;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"date";s:5:"value";s:4:"date";s:7:"keyword";s:4:"DATE";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:80;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:85;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"AFTER";s:5:"value";s:5:"AFTER";s:7:"keyword";s:5:"AFTER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:90;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"outmsg2";s:5:"value";s:7:"outmsg2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:96;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CHANGE";s:5:"value";s:6:"CHANGE";s:7:"keyword";s:6:"CHANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:104;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"inmsg2";s:5:"value";s:6:"inmsg2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:111;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:117;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"inmsg2";s:5:"value";s:6:"inmsg2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:118;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"time";s:5:"value";s:4:"time";s:7:"keyword";s:4:"TIME";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:125;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:130;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"AFTER";s:5:"value";s:5:"AFTER";s:7:"keyword";s:5:"AFTER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:135;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:140;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"inmsg";s:5:"value";s:5:"inmsg";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:141;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:146;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:38;s:3:"idx";i:38;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"tb_foo";s:6:"column";N;s:4:"expr";s:6:"tb_foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"CHANGE";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"inmsg";s:4:"expr";s:5:"inmsg";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:10:{i:0;r:93;i:1;r:100;i:2;r:107;i:3;r:114;i:4;r:121;i:5;r:128;i:6;r:135;i:7;r:142;i:8;r:149;i:9;r:156;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:35;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:52:"Missing comma before start of a new alter operation.";i:1;r:163;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- missing comma between alter operations\nALTER TABLE tb_foo CHANGE inmsg inmsg date NULL AFTER outmsg2 CHANGE inmsg2 inmsg2 time NULL AFTER inmsg;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- missing comma between alter operations\nALTER TABLE tb_foo CHANGE inmsg inmsg date NULL AFTER outmsg2 CHANGE inmsg2 inmsg2 time NULL AFTER inmsg;\n", + "len": 148, + "last": 148, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- missing comma between alter operations", + "value": "-- missing comma between alter operations", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tb_foo", + "value": "tb_foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "inmsg", + "value": "inmsg", + "keyword": null, + "type": 0, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "inmsg", + "value": "inmsg", + "keyword": null, + "type": 0, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "date", + "value": "date", + "keyword": "DATE", + "type": 1, + "flags": 41, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AFTER", + "value": "AFTER", + "keyword": "AFTER", + "type": 1, + "flags": 1, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "outmsg2", + "value": "outmsg2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHANGE", + "value": "CHANGE", + "keyword": "CHANGE", + "type": 1, + "flags": 3, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "inmsg2", + "value": "inmsg2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "inmsg2", + "value": "inmsg2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "time", + "value": "time", + "keyword": "TIME", + "type": 1, + "flags": 41, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AFTER", + "value": "AFTER", + "keyword": "AFTER", + "type": 1, + "flags": 1, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "inmsg", + "value": "inmsg", + "keyword": null, + "type": 0, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 38, + "idx": 38 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tb_foo", + "column": null, + "expr": "tb_foo", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CHANGE" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "inmsg", + "expr": "inmsg", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 35 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Missing comma before start of a new alter operation.", + { + "@type": "@24" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlterErr3.out b/tests/data/parser/parseAlterErr3.out index 9f5e434d1..b9acdadc9 100644 --- a/tests/data/parser/parseAlterErr3.out +++ b/tests/data/parser/parseAlterErr3.out @@ -1,7 +1,774 @@ -a:4:{s:5:"query";s:124:"-- missing comma between alter operations -ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:124:"-- missing comma between alter operations -ALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY; -";s:3:"len";i:124;s:4:"last";i:124;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:25:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:41:"-- missing comma between alter operations";s:5:"value";s:41:"-- missing comma between alter operations";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`database`";s:5:"value";s:8:"database";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:54;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`table`";s:5:"value";s:5:"table";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:65;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:73;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`field`";s:5:"value";s:5:"field";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:80;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:88;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:91;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:94;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:96;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:111;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:122;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:25;s:3:"idx";i:25;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:8:"database";s:5:"table";s:5:"table";s:6:"column";N;s:4:"expr";s:18:"`database`.`table`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"field";s:4:"expr";s:7:"`field`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:8:{i:0;r:107;i:1;r:114;i:2;r:121;i:3;r:128;i:4;r:135;i:5;r:142;i:6;r:149;i:7;r:156;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:22;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "-- missing comma between alter operations\nALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- missing comma between alter operations\nALTER TABLE `database`.`table` MODIFY `field` INT(11) AUTO_INCREMENT PRIMARY KEY;\n", + "len": 124, + "last": 124, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- missing comma between alter operations", + "value": "-- missing comma between alter operations", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`database`", + "value": "database", + "keyword": null, + "type": 8, + "flags": 2, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`table`", + "value": "table", + "keyword": null, + "type": 8, + "flags": 2, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`field`", + "value": "field", + "keyword": null, + "type": 8, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 25, + "idx": 25 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "database", + "table": "table", + "column": null, + "expr": "`database`.`table`", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "field", + "expr": "`field`", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 22 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlterTableSetAutoIncrementError.out b/tests/data/parser/parseAlterTableSetAutoIncrementError.out index 297f12cda..2d65547c6 100644 --- a/tests/data/parser/parseAlterTableSetAutoIncrementError.out +++ b/tests/data/parser/parseAlterTableSetAutoIncrementError.out @@ -1,4 +1,596 @@ -a:4:{s:5:"query";s:30:"ALTER TABLE t1 AUTO_INCREMENT -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:30:"ALTER TABLE t1 AUTO_INCREMENT -";s:3:"len";i:30;s:4:"last";i:30;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:14:"AUTO_INCREMENT";s:6:"equals";b:1;s:4:"expr";s:0:"";s:5:"value";s:0:"";}}}s:5:"field";N;s:7:"unknown";a:0:{}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:60:"Value/Expression for the option AUTO_INCREMENT was expected.";i:1;r:58;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "ALTER TABLE t1 AUTO_INCREMENT\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE t1 AUTO_INCREMENT\n", + "len": 30, + "last": 30, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "AUTO_INCREMENT", + "equals": true, + "expr": "", + "value": "" + } + } + }, + "field": null, + "unknown": [] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Value\/Expression for the option AUTO_INCREMENT was expected.", + { + "@type": "@9" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseAlterWithInvisible.out b/tests/data/parser/parseAlterWithInvisible.out index 134d47c6d..e63698087 100644 --- a/tests/data/parser/parseAlterWithInvisible.out +++ b/tests/data/parser/parseAlterWithInvisible.out @@ -1,4 +1,1140 @@ -a:4:{s:5:"query";s:85:"ALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL DEFAULT 4; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:85:"ALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL DEFAULT 4; -";s:3:"len";i:85;s:4:"last";i:85;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:36:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"ALTER";s:5:"value";s:5:"ALTER";s:7:"keyword";s:5:"ALTER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:23;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"INVISIBLE";s:5:"value";s:9:"INVISIBLE";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:38;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"y";s:5:"value";s:1:"y";s:7:"keyword";s:1:"Y";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MODIFY";s:5:"value";s:6:"MODIFY";s:7:"keyword";s:6:"MODIFY";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"z";s:5:"value";s:1:"z";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:61;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:65;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:74;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"4";s:5:"value";i:4;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:82;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:83;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:36;s:3:"idx";i:36;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\AlterStatement":5:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"t";s:6:"column";N;s:4:"expr";s:1:"t";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"altered";a:3:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"x";s:4:"expr";s:1:"x";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:3:{i:0;r:79;i:1;r:86;i:2;r:93;}}i:1;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"y";s:4:"expr";s:1:"y";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:1:{i:0;r:142;}}i:2;O:46:"PhpMyAdmin\SqlParser\Components\AlterOperation":3:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"MODIFY";}}s:5:"field";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"z";s:4:"expr";s:1:"z";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"unknown";a:7:{i:0;r:191;i:1;r:198;i:2;r:205;i:3;r:212;i:4;r:219;i:5;r:226;i:6;r:233;}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:33;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "ALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL DEFAULT 4;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "ALTER TABLE t MODIFY x INT INVISIBLE, MODIFY y INT, MODIFY z INT NOT NULL DEFAULT 4;\n", + "len": 85, + "last": 85, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALTER", + "value": "ALTER", + "keyword": "ALTER", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 1, + "flags": 33, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INVISIBLE", + "value": "INVISIBLE", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "y", + "value": "y", + "keyword": "Y", + "type": 1, + "flags": 33, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MODIFY", + "value": "MODIFY", + "keyword": "MODIFY", + "type": 1, + "flags": 1, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "z", + "value": "z", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "4", + "value": 4, + "keyword": null, + "type": 6, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 36, + "idx": 36 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t", + "column": null, + "expr": "t", + "alias": null, + "function": null, + "subquery": null + }, + "altered": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "x", + "expr": "x", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@12" + }, + { + "@type": "@13" + }, + { + "@type": "@14" + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "y", + "expr": "y", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@21" + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var" + ], + "CHARSET": [ + 1, + "var" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var" + ], + "DEFAULT CHARSET": [ + 1, + "var" + ], + "UPGRADE": [ + 1, + "var" + ], + "COLLATE": [ + 2, + "var" + ], + "DEFAULT COLLATE": [ + 2, + "var" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 1, + "var=" + ], + "AVG_ROW_LENGTH": [ + 1, + "var" + ], + "MAX_ROWS": [ + 1, + "var" + ], + "ROW_FORMAT": [ + 1, + "var" + ], + "COMMENT": [ + 1, + "var" + ], + "ADD": 1, + "ALTER": 1, + "ANALYZE": 1, + "CHANGE": 1, + "CHECK": 1, + "COALESCE": 1, + "CONVERT": 1, + "DISABLE": 1, + "DISCARD": 1, + "DROP": 1, + "ENABLE": 1, + "IMPORT": 1, + "MODIFY": 1, + "OPTIMIZE": 1, + "ORDER": 1, + "PARTITION": 1, + "REBUILD": 1, + "REMOVE": 1, + "RENAME": 1, + "REORGANIZE": 1, + "REPAIR": 1, + "UPGRADE": 1, + "COLUMN": 2, + "CONSTRAINT": 2, + "DEFAULT": 2, + "TO": 2, + "BY": 2, + "FOREIGN": 2, + "FULLTEXT": 2, + "KEY": 2, + "KEYS": 2, + "PARTITIONING": 2, + "PRIMARY KEY": 2, + "SPATIAL": 2, + "TABLESPACE": 2, + "INDEX": 2 + }, + "VIEW_OPTIONS": { + "AS": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "MODIFY" + } + }, + "field": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "z", + "expr": "z", + "alias": null, + "function": null, + "subquery": null + }, + "unknown": [ + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + } + ] + } + ], + "OPTIONS": { + "ONLINE": 1, + "OFFLINE": 1, + "IGNORE": 2, + "DATABASE": 3, + "EVENT": 3, + "FUNCTION": 3, + "PROCEDURE": 3, + "SERVER": 3, + "TABLE": 3, + "TABLESPACE": 3, + "VIEW": 3 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "TABLE" + } + }, + "first": 0, + "last": 33 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseArrayErr1.out b/tests/data/parser/parseArrayErr1.out index 8d776739a..d4f788281 100644 --- a/tests/data/parser/parseArrayErr1.out +++ b/tests/data/parser/parseArrayErr1.out @@ -1 +1,749 @@ -a:4:{s:5:"query";s:38:"SELECT * FROM foo PARTITION bar, baz);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:38:"SELECT * FROM foo PARTITION bar, baz);";s:3:"len";i:38;s:4:"last";i:38;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:37;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:0:{}s:6:"values";a:0:{}}s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:14;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:32:"An opening bracket was expected.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:86;i:2;i:0;}i:2;a:3:{i:0;s:17:"Unexpected token.";i:1;r:100;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM foo PARTITION bar, baz);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM foo PARTITION bar, baz);", + "len": 38, + "last": 38, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [], + "values": [] + }, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 14 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An opening bracket was expected.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@13" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@15" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseArrayErr3.out b/tests/data/parser/parseArrayErr3.out index 7a5be6286..7142ac8ab 100644 --- a/tests/data/parser/parseArrayErr3.out +++ b/tests/data/parser/parseArrayErr3.out @@ -1 +1,726 @@ -a:4:{s:5:"query";s:38:"SELECT * FROM foo PARTITION (bar, baz;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:38:"SELECT * FROM foo PARTITION (bar, baz;";s:3:"len";i:38;s:4:"last";i:38;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:37;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:3:"bar";i:1;s:3:"baz";}s:6:"values";a:2:{i:0;s:3:"bar";i:1;s:3:"baz";}}s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM foo PARTITION (bar, baz;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM foo PARTITION (bar, baz;", + "len": 38, + "last": 38, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "bar", + "baz" + ], + "values": [ + "bar", + "baz" + ] + }, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCall.out b/tests/data/parser/parseCall.out index a3642b038..410246c7e 100644 --- a/tests/data/parser/parseCall.out +++ b/tests/data/parser/parseCall.out @@ -1 +1,426 @@ -a:4:{s:5:"query";s:11:"CALL foo();";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:11:"CALL foo();";s:3:"len";i:11;s:4:"last";i:11;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:7:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"CALL";s:5:"value";s:4:"CALL";s:7:"keyword";s:4:"CALL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:7;s:3:"idx";i:7;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\CallStatement":4:{s:4:"call";O:44:"PhpMyAdmin\SqlParser\Components\FunctionCall":2:{s:4:"name";s:3:"foo";s:10:"parameters";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:0:{}s:6:"values";a:0:{}}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CALL foo();", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CALL foo();", + "len": 11, + "last": 11, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CALL", + "value": "CALL", + "keyword": "CALL", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 7, + "idx": 7 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "call": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "name": "foo", + "parameters": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [], + "values": [] + } + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCall2.out b/tests/data/parser/parseCall2.out index 049bdde3c..56bb9704b 100644 --- a/tests/data/parser/parseCall2.out +++ b/tests/data/parser/parseCall2.out @@ -1 +1,468 @@ -a:4:{s:5:"query";s:21:"CALL foo(@bar, @baz);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:21:"CALL foo(@bar, @baz);";s:3:"len";i:21;s:4:"last";i:21;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"CALL";s:5:"value";s:4:"CALL";s:7:"keyword";s:4:"CALL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:15;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:20;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\CallStatement":4:{s:4:"call";O:44:"PhpMyAdmin\SqlParser\Components\FunctionCall":2:{s:4:"name";s:3:"foo";s:10:"parameters";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:4:"@bar";i:1;s:4:"@baz";}s:6:"values";a:2:{i:0;s:3:"bar";i:1;s:3:"baz";}}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CALL foo(@bar, @baz);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CALL foo(@bar, @baz);", + "len": 21, + "last": 21, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CALL", + "value": "CALL", + "keyword": "CALL", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@bar", + "value": "bar", + "keyword": null, + "type": 8, + "flags": 1, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@baz", + "value": "baz", + "keyword": null, + "type": 8, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "call": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "name": "foo", + "parameters": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "@bar", + "@baz" + ], + "values": [ + "bar", + "baz" + ] + } + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCall3.out b/tests/data/parser/parseCall3.out index 5f8b7b10a..61d475e24 100644 --- a/tests/data/parser/parseCall3.out +++ b/tests/data/parser/parseCall3.out @@ -1 +1,404 @@ -a:4:{s:5:"query";s:9:"CALL foo;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:9:"CALL foo;";s:3:"len";i:9;s:4:"last";i:9;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"CALL";s:5:"value";s:4:"CALL";s:7:"keyword";s:4:"CALL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\CallStatement":4:{s:4:"call";O:44:"PhpMyAdmin\SqlParser\Components\FunctionCall":2:{s:4:"name";s:3:"foo";s:10:"parameters";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:2;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CALL foo;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CALL foo;", + "len": 9, + "last": 9, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CALL", + "value": "CALL", + "keyword": "CALL", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "call": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "name": "foo", + "parameters": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 2 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateDatabase.out b/tests/data/parser/parseCreateDatabase.out index 72b7b9be5..dffdad7e3 100644 --- a/tests/data/parser/parseCreateDatabase.out +++ b/tests/data/parser/parseCreateDatabase.out @@ -1 +1,706 @@ -a:4:{s:5:"query";s:57:"CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:57:"CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';";s:3:"len";i:57;s:4:"last";i:57;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DATABASE";s:5:"value";s:8:"DATABASE";s:7:"keyword";s:8:"DATABASE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pma";s:5:"value";s:3:"pma";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:50;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:56;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:3:"pma";s:5:"table";N;s:6:"column";N;s:4:"expr";s:3:"pma";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:8:"DATABASE";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';", + "len": 57, + "last": 57, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATABASE", + "value": "DATABASE", + "keyword": "DATABASE", + "type": 1, + "flags": 35, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pma", + "value": "pma", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "pma", + "table": null, + "column": null, + "expr": "pma", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "DATABASE", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateDatabaseErr.out b/tests/data/parser/parseCreateDatabaseErr.out index 162d79639..e8e145036 100644 --- a/tests/data/parser/parseCreateDatabaseErr.out +++ b/tests/data/parser/parseCreateDatabaseErr.out @@ -1 +1,734 @@ -a:4:{s:5:"query";s:72:"CREATE DATABASE IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:72:"CREATE DATABASE IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'";s:3:"len";i:72;s:4:"last";i:72;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DATABASE";s:5:"value";s:8:"DATABASE";s:7:"keyword";s:8:"DATABASE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pma";s:5:"value";s:3:"pma";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:40;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'InnoDB'";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:41;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:50;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:66;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:3:"pma";s:5:"table";N;s:6:"column";N;s:4:"expr";s:3:"pma";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:8:"DATABASE";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE DATABASE IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE DATABASE IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'", + "len": 72, + "last": 72, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATABASE", + "value": "DATABASE", + "keyword": "DATABASE", + "type": 1, + "flags": 35, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pma", + "value": "pma", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'InnoDB'", + "value": "InnoDB", + "keyword": null, + "type": 7, + "flags": 1, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "pma", + "table": null, + "column": null, + "expr": "pma", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "DATABASE", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized statement type.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateFunction.out b/tests/data/parser/parseCreateFunction.out index 576b9f054..37a257717 100644 --- a/tests/data/parser/parseCreateFunction.out +++ b/tests/data/parser/parseCreateFunction.out @@ -1,16 +1,1266 @@ -a:4:{s:5:"query";s:180:"CREATE FUNCTION F_TEST(uid INT) RETURNS VARCHAR -BEGIN - DECLARE username VARCHAR DEFAULT ""; - SELECT username INTO username FROM users WHERE ID = uid; - RETURN username; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:180:"CREATE FUNCTION F_TEST(uid INT) RETURNS VARCHAR -BEGIN - DECLARE username VARCHAR DEFAULT ""; - SELECT username INTO username FROM users WHERE ID = uid; - RETURN username; -END";s:3:"len";i:180;s:4:"last";i:180;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:56:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"FUNCTION";s:5:"value";s:8:"FUNCTION";s:7:"keyword";s:8:"FUNCTION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"F_TEST";s:5:"value";s:6:"F_TEST";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"RETURNS";s:5:"value";s:7:"RETURNS";s:7:"keyword";s:7:"RETURNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:48;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DECLARE";s:5:"value";s:7:"DECLARE";s:7:"keyword";s:7:"DECLARE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:58;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:66;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:83;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"""";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:91;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:93;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:94;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:99;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:105;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:106;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:115;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:119;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:120;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:128;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:129;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:134;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:140;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ID";s:5:"value";s:2:"ID";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:146;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:149;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:150;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:151;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:154;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:155;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RETURN";s:5:"value";s:6:"RETURN";s:7:"keyword";s:6:"RETURN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:160;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:166;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:167;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:175;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:177;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:56;s:3:"idx";i:57;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"F_TEST";s:6:"column";N;s:4:"expr";s:6:"F_TEST";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"parameters";a:1:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\ParameterDefinition":3:{s:4:"name";s:3:"uid";s:5:"inOut";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}}s:4:"body";a:41:{i:0;r:114;i:1;r:121;i:2;r:128;i:3;r:135;i:4;r:142;i:5;r:149;i:6;r:156;i:7;r:163;i:8;r:170;i:9;r:177;i:10;r:184;i:11;r:191;i:12;r:198;i:13;r:205;i:14;r:212;i:15;r:219;i:16;r:226;i:17;r:233;i:18;r:240;i:19;r:247;i:20;r:254;i:21;r:261;i:22;r:268;i:23;r:275;i:24;r:282;i:25;r:289;i:26;r:296;i:27;r:303;i:28;r:310;i:29;r:317;i:30;r:324;i:31;r:331;i:32;r:338;i:33;r:345;i:34;r:352;i:35;r:359;i:36;r:366;i:37;r:373;i:38;r:380;i:39;r:387;i:40;r:394;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:8:"FUNCTION";}}s:5:"first";i:0;s:4:"last";i:56;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE FUNCTION F_TEST(uid INT) RETURNS VARCHAR\nBEGIN\n DECLARE username VARCHAR DEFAULT \"\";\n SELECT username INTO username FROM users WHERE ID = uid;\n RETURN username;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE FUNCTION F_TEST(uid INT) RETURNS VARCHAR\nBEGIN\n DECLARE username VARCHAR DEFAULT \"\";\n SELECT username INTO username FROM users WHERE ID = uid;\n RETURN username;\nEND", + "len": 180, + "last": 180, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FUNCTION", + "value": "FUNCTION", + "keyword": "FUNCTION", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "F_TEST", + "value": "F_TEST", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RETURNS", + "value": "RETURNS", + "keyword": "RETURNS", + "type": 1, + "flags": 1, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DECLARE", + "value": "DECLARE", + "keyword": "DECLARE", + "type": 1, + "flags": 3, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"\"", + "value": "", + "keyword": null, + "type": 7, + "flags": 2, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ID", + "value": "ID", + "keyword": null, + "type": 0, + "flags": 0, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RETURN", + "value": "RETURN", + "keyword": "RETURN", + "type": 1, + "flags": 3, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 56, + "idx": 57 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "F_TEST", + "column": null, + "expr": "F_TEST", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "parameters": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ParameterDefinition", + "name": "uid", + "inOut": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + } + ], + "body": [ + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + }, + { + "@type": "@35" + }, + { + "@type": "@36" + }, + { + "@type": "@37" + }, + { + "@type": "@38" + }, + { + "@type": "@39" + }, + { + "@type": "@40" + }, + { + "@type": "@41" + }, + { + "@type": "@42" + }, + { + "@type": "@43" + }, + { + "@type": "@44" + }, + { + "@type": "@45" + }, + { + "@type": "@46" + }, + { + "@type": "@47" + }, + { + "@type": "@48" + }, + { + "@type": "@49" + }, + { + "@type": "@50" + }, + { + "@type": "@51" + }, + { + "@type": "@52" + }, + { + "@type": "@53" + }, + { + "@type": "@54" + }, + { + "@type": "@55" + }, + { + "@type": "@56" + }, + { + "@type": "@57" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "FUNCTION" + } + }, + "first": 0, + "last": 56 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateFunctionErr1.out b/tests/data/parser/parseCreateFunctionErr1.out index 7ac97deea..976972fec 100644 --- a/tests/data/parser/parseCreateFunctionErr1.out +++ b/tests/data/parser/parseCreateFunctionErr1.out @@ -1,16 +1,1207 @@ -a:4:{s:5:"query";s:164:"CREATE FUNCTION F_TEST(uid INT) -BEGIN - DECLARE username VARCHAR DEFAULT ""; - SELECT username INTO username FROM users WHERE ID = uid; - RETURN username; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:164:"CREATE FUNCTION F_TEST(uid INT) -BEGIN - DECLARE username VARCHAR DEFAULT ""; - SELECT username INTO username FROM users WHERE ID = uid; - RETURN username; -END";s:3:"len";i:164;s:4:"last";i:164;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:52:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"FUNCTION";s:5:"value";s:8:"FUNCTION";s:7:"keyword";s:8:"FUNCTION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"F_TEST";s:5:"value";s:6:"F_TEST";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DECLARE";s:5:"value";s:7:"DECLARE";s:7:"keyword";s:7:"DECLARE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:67;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"""";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:77;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:83;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:90;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:99;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:104;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:113;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:117;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:118;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:124;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ID";s:5:"value";s:2:"ID";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:133;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:135;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:138;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RETURN";s:5:"value";s:6:"RETURN";s:7:"keyword";s:6:"RETURN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:144;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:150;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:151;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:159;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:161;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:52;s:3:"idx";i:53;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"F_TEST";s:6:"column";N;s:4:"expr";s:6:"F_TEST";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";a:1:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\ParameterDefinition":3:{s:4:"name";s:3:"uid";s:5:"inOut";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}}s:4:"body";a:39:{i:0;r:100;i:1;r:107;i:2;r:114;i:3;r:121;i:4;r:128;i:5;r:135;i:6;r:142;i:7;r:149;i:8;r:156;i:9;r:163;i:10;r:170;i:11;r:177;i:12;r:184;i:13;r:191;i:14;r:198;i:15;r:205;i:16;r:212;i:17;r:219;i:18;r:226;i:19;r:233;i:20;r:240;i:21;r:247;i:22;r:254;i:23;r:261;i:24;r:268;i:25;r:275;i:26;r:282;i:27;r:289;i:28;r:296;i:29;r:303;i:30;r:310;i:31;r:317;i:32;r:324;i:33;r:331;i:34;r:338;i:35;r:345;i:36;r:352;i:37;r:359;i:38;r:366;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:8:"FUNCTION";}}s:5:"first";i:0;s:4:"last";i:52;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:33:"A "RETURNS" keyword was expected.";i:1;r:86;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE FUNCTION F_TEST(uid INT)\nBEGIN\n DECLARE username VARCHAR DEFAULT \"\";\n SELECT username INTO username FROM users WHERE ID = uid;\n RETURN username;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE FUNCTION F_TEST(uid INT)\nBEGIN\n DECLARE username VARCHAR DEFAULT \"\";\n SELECT username INTO username FROM users WHERE ID = uid;\n RETURN username;\nEND", + "len": 164, + "last": 164, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FUNCTION", + "value": "FUNCTION", + "keyword": "FUNCTION", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "F_TEST", + "value": "F_TEST", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DECLARE", + "value": "DECLARE", + "keyword": "DECLARE", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"\"", + "value": "", + "keyword": null, + "type": 7, + "flags": 2, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ID", + "value": "ID", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RETURN", + "value": "RETURN", + "keyword": "RETURN", + "type": 1, + "flags": 3, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 52, + "idx": 53 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "F_TEST", + "column": null, + "expr": "F_TEST", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ParameterDefinition", + "name": "uid", + "inOut": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + } + ], + "body": [ + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + }, + { + "@type": "@35" + }, + { + "@type": "@36" + }, + { + "@type": "@37" + }, + { + "@type": "@38" + }, + { + "@type": "@39" + }, + { + "@type": "@40" + }, + { + "@type": "@41" + }, + { + "@type": "@42" + }, + { + "@type": "@43" + }, + { + "@type": "@44" + }, + { + "@type": "@45" + }, + { + "@type": "@46" + }, + { + "@type": "@47" + }, + { + "@type": "@48" + }, + { + "@type": "@49" + }, + { + "@type": "@50" + }, + { + "@type": "@51" + }, + { + "@type": "@52" + }, + { + "@type": "@53" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "FUNCTION" + } + }, + "first": 0, + "last": 52 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A \"RETURNS\" keyword was expected.", + { + "@type": "@13" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateFunctionErr2.out b/tests/data/parser/parseCreateFunctionErr2.out index 39903d50b..bc372448d 100644 --- a/tests/data/parser/parseCreateFunctionErr2.out +++ b/tests/data/parser/parseCreateFunctionErr2.out @@ -1 +1,671 @@ -a:4:{s:5:"query";s:30:"CREATE FUNCTION test() RETURNS";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:30:"CREATE FUNCTION test() RETURNS";s:3:"len";i:30;s:4:"last";i:30;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"FUNCTION";s:5:"value";s:8:"FUNCTION";s:7:"keyword";s:8:"FUNCTION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"RETURNS";s:5:"value";s:7:"RETURNS";s:7:"keyword";s:7:"RETURNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";a:0:{}s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:8:"FUNCTION";}}s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE FUNCTION test() RETURNS", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE FUNCTION test() RETURNS", + "len": 30, + "last": 30, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FUNCTION", + "value": "FUNCTION", + "keyword": "FUNCTION", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RETURNS", + "value": "RETURNS", + "keyword": "RETURNS", + "type": 1, + "flags": 1, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": [], + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "FUNCTION" + } + }, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateFunctionErr3.out b/tests/data/parser/parseCreateFunctionErr3.out index cbf6ccaf0..3f0a3190d 100644 --- a/tests/data/parser/parseCreateFunctionErr3.out +++ b/tests/data/parser/parseCreateFunctionErr3.out @@ -1,7 +1,724 @@ -a:3:{s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:45:"DELIMITER $$ -CREATE FUNCTION coincide -END;$$ -";s:3:"len";i:45;s:4:"last";i:45;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"$$";s:5:"value";s:2:"$$";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"FUNCTION";s:5:"value";s:8:"FUNCTION";s:7:"keyword";s:8:"FUNCTION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"coincide";s:5:"value";s:8:"coincide";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:38;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"$$";s:5:"value";s:2:"$$";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:17;}s:9:"delimiter";s:2:"$$";s:12:"delimiterLen";i:2;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:6;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"coincide";s:6:"column";N;s:4:"expr";s:8:"coincide";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";a:0:{}s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:8:"FUNCTION";}}s:5:"first";i:4;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:6:"parser";a:1:{i:0;a:3:{i:0;s:33:"A "RETURNS" keyword was expected.";i:1;r:78;i:2;i:0;}}s:5:"lexer";a:0:{}}} \ No newline at end of file +{ + "query": "DELIMITER $$\nCREATE FUNCTION coincide\nEND;$$\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELIMITER $$\nCREATE FUNCTION coincide\nEND;$$\n", + "len": 45, + "last": 45, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "$$", + "value": "$$", + "keyword": null, + "type": 9, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FUNCTION", + "value": "FUNCTION", + "keyword": "FUNCTION", + "type": 1, + "flags": 1, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "coincide", + "value": "coincide", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "$$", + "value": "$$", + "keyword": null, + "type": 9, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": "$$", + "delimiterLen": 2, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "coincide", + "column": null, + "expr": "coincide", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": [], + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "FUNCTION" + } + }, + "first": 4, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A \"RETURNS\" keyword was expected.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateProcedure.out b/tests/data/parser/parseCreateProcedure.out index 09109d1c5..7b1bc4729 100644 --- a/tests/data/parser/parseCreateProcedure.out +++ b/tests/data/parser/parseCreateProcedure.out @@ -1,10 +1,965 @@ -a:4:{s:5:"query";s:89:"CREATE PROCEDURE P_TEST(uid INT) -BEGIN - SELECT username FROM users WHERE ID = uid; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:89:"CREATE PROCEDURE P_TEST(uid INT) -BEGIN - SELECT username FROM users WHERE ID = uid; -END";s:3:"len";i:89;s:4:"last";i:89;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:32:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PROCEDURE";s:5:"value";s:9:"PROCEDURE";s:7:"keyword";s:9:"PROCEDURE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"P_TEST";s:5:"value";s:6:"P_TEST";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:24;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:28;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:70;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ID";s:5:"value";s:2:"ID";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:76;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:79;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:81;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:84;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:86;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:32;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"P_TEST";s:6:"column";N;s:4:"expr";s:6:"P_TEST";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";a:1:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\ParameterDefinition":3:{s:4:"name";s:3:"uid";s:5:"inOut";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}}s:4:"body";a:21:{i:0;r:86;i:1;r:93;i:2;r:100;i:3;r:107;i:4;r:114;i:5;r:121;i:6;r:128;i:7;r:135;i:8;r:142;i:9;r:149;i:10;r:156;i:11;r:163;i:12;r:170;i:13;r:177;i:14;r:184;i:15;r:191;i:16;r:198;i:17;r:205;i:18;r:212;i:19;r:219;i:20;r:226;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:9:"PROCEDURE";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE PROCEDURE P_TEST(uid INT)\nBEGIN\n SELECT username FROM users WHERE ID = uid;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE PROCEDURE P_TEST(uid INT)\nBEGIN\n SELECT username FROM users WHERE ID = uid;\nEND", + "len": 89, + "last": 89, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PROCEDURE", + "value": "PROCEDURE", + "keyword": "PROCEDURE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "P_TEST", + "value": "P_TEST", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ID", + "value": "ID", + "keyword": null, + "type": 0, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 32, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "P_TEST", + "column": null, + "expr": "P_TEST", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ParameterDefinition", + "name": "uid", + "inOut": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + } + ], + "body": [ + { + "@type": "@13" + }, + { + "@type": "@14" + }, + { + "@type": "@15" + }, + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "PROCEDURE" + } + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateProcedure2.out b/tests/data/parser/parseCreateProcedure2.out index 11e4cee91..eeec7dc38 100644 --- a/tests/data/parser/parseCreateProcedure2.out +++ b/tests/data/parser/parseCreateProcedure2.out @@ -1,10 +1,1077 @@ -a:4:{s:5:"query";s:111:"CREATE PROCEDURE P_TEST(IN uid INT, IN unused VARCHAR) -BEGIN - SELECT username FROM users WHERE ID = uid; -END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:111:"CREATE PROCEDURE P_TEST(IN uid INT, IN unused VARCHAR) -BEGIN - SELECT username FROM users WHERE ID = uid; -END";s:3:"len";i:111;s:4:"last";i:111;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:41:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PROCEDURE";s:5:"value";s:9:"PROCEDURE";s:7:"keyword";s:9:"PROCEDURE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"P_TEST";s:5:"value";s:6:"P_TEST";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IN";s:5:"value";s:2:"IN";s:7:"keyword";s:2:"IN";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:24;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IN";s:5:"value";s:2:"IN";s:7:"keyword";s:2:"IN";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"unused";s:5:"value";s:6:"unused";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:53;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:65;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:72;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ID";s:5:"value";s:2:"ID";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:98;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:101;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"uid";s:5:"value";s:3:"uid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:103;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:106;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:41;s:3:"idx";i:42;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"P_TEST";s:6:"column";N;s:4:"expr";s:6:"P_TEST";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\ParameterDefinition":3:{s:4:"name";s:3:"uid";s:5:"inOut";s:2:"IN";s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\ParameterDefinition":3:{s:4:"name";s:6:"unused";s:5:"inOut";s:2:"IN";s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}}s:4:"body";a:21:{i:0;r:149;i:1;r:156;i:2;r:163;i:3;r:170;i:4;r:177;i:5;r:184;i:6;r:191;i:7;r:198;i:8;r:205;i:9;r:212;i:10;r:219;i:11;r:226;i:12;r:233;i:13;r:240;i:14;r:247;i:15;r:254;i:16;r:261;i:17;r:268;i:18;r:275;i:19;r:282;i:20;r:289;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:9:"PROCEDURE";}}s:5:"first";i:0;s:4:"last";i:41;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE PROCEDURE P_TEST(IN uid INT, IN unused VARCHAR)\nBEGIN\n SELECT username FROM users WHERE ID = uid;\nEND", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE PROCEDURE P_TEST(IN uid INT, IN unused VARCHAR)\nBEGIN\n SELECT username FROM users WHERE ID = uid;\nEND", + "len": 111, + "last": 111, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PROCEDURE", + "value": "PROCEDURE", + "keyword": "PROCEDURE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "P_TEST", + "value": "P_TEST", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IN", + "value": "IN", + "keyword": "IN", + "type": 1, + "flags": 35, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IN", + "value": "IN", + "keyword": "IN", + "type": 1, + "flags": 35, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "unused", + "value": "unused", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ID", + "value": "ID", + "keyword": null, + "type": 0, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "uid", + "value": "uid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 41, + "idx": 42 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "P_TEST", + "column": null, + "expr": "P_TEST", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ParameterDefinition", + "name": "uid", + "inOut": "IN", + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ParameterDefinition", + "name": "unused", + "inOut": "IN", + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + } + ], + "body": [ + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + }, + { + "@type": "@35" + }, + { + "@type": "@36" + }, + { + "@type": "@37" + }, + { + "@type": "@38" + }, + { + "@type": "@39" + }, + { + "@type": "@40" + }, + { + "@type": "@41" + }, + { + "@type": "@42" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "PROCEDURE" + } + }, + "first": 0, + "last": 41 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateSchema.out b/tests/data/parser/parseCreateSchema.out index 72b7b9be5..dffdad7e3 100644 --- a/tests/data/parser/parseCreateSchema.out +++ b/tests/data/parser/parseCreateSchema.out @@ -1 +1,706 @@ -a:4:{s:5:"query";s:57:"CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:57:"CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';";s:3:"len";i:57;s:4:"last";i:57;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DATABASE";s:5:"value";s:8:"DATABASE";s:7:"keyword";s:8:"DATABASE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pma";s:5:"value";s:3:"pma";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:50;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:56;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:3:"pma";s:5:"table";N;s:6:"column";N;s:4:"expr";s:3:"pma";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:8:"DATABASE";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE DATABASE IF NOT EXISTS pma DEFAULT CHARSET 'utf8';", + "len": 57, + "last": 57, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATABASE", + "value": "DATABASE", + "keyword": "DATABASE", + "type": 1, + "flags": 35, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pma", + "value": "pma", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "pma", + "table": null, + "column": null, + "expr": "pma", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "DATABASE", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateSchemaErr.out b/tests/data/parser/parseCreateSchemaErr.out index 0ab2bf88c..ec9fae37d 100644 --- a/tests/data/parser/parseCreateSchemaErr.out +++ b/tests/data/parser/parseCreateSchemaErr.out @@ -1 +1,734 @@ -a:4:{s:5:"query";s:70:"CREATE SCHEMA IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:70:"CREATE SCHEMA IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'";s:3:"len";i:70;s:4:"last";i:70;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SCHEMA";s:5:"value";s:6:"SCHEMA";s:7:"keyword";s:6:"SCHEMA";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pma";s:5:"value";s:3:"pma";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:32;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:38;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'InnoDB'";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:48;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:64;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:3:"pma";s:5:"table";N;s:6:"column";N;s:4:"expr";s:3:"pma";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:6:"SCHEMA";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE SCHEMA IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE SCHEMA IF NOT EXISTS pma ENGINE='InnoDB' DEFAULT CHARSET 'utf8'", + "len": 70, + "last": 70, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SCHEMA", + "value": "SCHEMA", + "keyword": "SCHEMA", + "type": 1, + "flags": 35, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pma", + "value": "pma", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'InnoDB'", + "value": "InnoDB", + "keyword": null, + "type": 7, + "flags": 1, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "pma", + "table": null, + "column": null, + "expr": "pma", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "SCHEMA", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized statement type.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable.out b/tests/data/parser/parseCreateTable.out index cc2733edd..2f7ac23f3 100644 --- a/tests/data/parser/parseCreateTable.out +++ b/tests/data/parser/parseCreateTable.out @@ -1,19 +1,1684 @@ -a:4:{s:5:"query";s:229:"CREATE TABLE IF NOT EXISTS users ( - `id` INT NOT NULL AUTO_INCREMENT, - username VARCHAR(64) NULL, - `password` VARCHAR(256) DEFAULT '123456', - CONSTRAINT pk_id PRIMARY KEY (`id`), - UNIQUE (username) -) ENGINE=InnoDB;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:229:"CREATE TABLE IF NOT EXISTS users ( - `id` INT NOT NULL AUTO_INCREMENT, - username VARCHAR(64) NULL, - `password` VARCHAR(256) DEFAULT '123456', - CONSTRAINT pk_id PRIMARY KEY (`id`), - UNIQUE (username) -) ENGINE=InnoDB;";s:3:"len";i:229;s:4:"last";i:229;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:65:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:48;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:57;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:77;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:86;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:93;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"64";s:5:"value";i:64;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:96;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:98;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:102;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`password`";s:5:"value";s:8:"password";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:108;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:119;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:126;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"256";s:5:"value";i:256;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:127;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:130;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:132;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'123456'";s:5:"value";s:6:"123456";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:140;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:148;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:149;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONSTRAINT";s:5:"value";s:10:"CONSTRAINT";s:7:"keyword";s:10:"CONSTRAINT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:154;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:164;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"pk_id";s:5:"value";s:5:"pk_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:165;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:170;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:171;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:182;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:183;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:184;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:188;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:189;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:190;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UNIQUE";s:5:"value";s:6:"UNIQUE";s:7:"keyword";s:6:"UNIQUE";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:195;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:201;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:202;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:203;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:211;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:212;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:213;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:214;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:215;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:221;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:222;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:228;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:65;s:3:"idx";i:65;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}s:6:"fields";a:5:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:3;s:14:"AUTO_INCREMENT";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:8:"username";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:2:"64";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:4:"NULL";}}}i:2;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:8:"password";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:3:"256";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"123456";s:4:"expr";s:8:"'123456'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:8:"'123456'";}}}}i:3;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:5:"pk_id";s:12:"isConstraint";b:1;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:2:"id";}}s:4:"type";s:11:"PRIMARY KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:4;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:8:"username";}}s:4:"type";s:6:"UNIQUE";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:5:"TABLE";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:63;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE IF NOT EXISTS users (\n `id` INT NOT NULL AUTO_INCREMENT,\n username VARCHAR(64) NULL,\n `password` VARCHAR(256) DEFAULT '123456',\n CONSTRAINT pk_id PRIMARY KEY (`id`),\n UNIQUE (username)\n) ENGINE=InnoDB;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE IF NOT EXISTS users (\n `id` INT NOT NULL AUTO_INCREMENT,\n username VARCHAR(64) NULL,\n `password` VARCHAR(256) DEFAULT '123456',\n CONSTRAINT pk_id PRIMARY KEY (`id`),\n UNIQUE (username)\n) ENGINE=InnoDB;", + "len": 229, + "last": 229, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "64", + "value": 64, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`password`", + "value": "password", + "keyword": null, + "type": 8, + "flags": 2, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "256", + "value": 256, + "keyword": null, + "type": 6, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123456'", + "value": "123456", + "keyword": null, + "type": 7, + "flags": 1, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONSTRAINT", + "value": "CONSTRAINT", + "keyword": "CONSTRAINT", + "type": 1, + "flags": 3, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pk_id", + "value": "pk_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 184 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNIQUE", + "value": "UNIQUE", + "keyword": "UNIQUE", + "type": 1, + "flags": 19, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 203 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 213 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 215 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 228 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 65, + "idx": 65 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "3": "AUTO_INCREMENT" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "username", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "64" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "password", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "256" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "123456", + "expr": "'123456'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'123456'" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "pk_id", + "isConstraint": true, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "id" + } + ], + "type": "PRIMARY KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "username" + } + ], + "type": "UNIQUE", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 63 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable2.out b/tests/data/parser/parseCreateTable2.out index 182869d4b..517d2a251 100644 --- a/tests/data/parser/parseCreateTable2.out +++ b/tests/data/parser/parseCreateTable2.out @@ -1,46 +1,4112 @@ -a:4:{s:5:"query";s:940:"CREATE TABLE `payment` ( - `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `customer_id` smallint(5) unsigned NOT NULL, - `staff_id` tinyint(3) unsigned NOT NULL, - `rental_id` int(11) DEFAULT NULL, - `amount` decimal(5,2) NOT NULL, - `payment_date` datetime NOT NULL, - `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`payment_id`), - KEY `idx_fk_staff_id` (`staff_id`), - KEY `idx_fk_customer_id` (`customer_id`), - KEY `fk_payment_rental` (`rental_id`), - CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE, - CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:940:"CREATE TABLE `payment` ( - `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `customer_id` smallint(5) unsigned NOT NULL, - `staff_id` tinyint(3) unsigned NOT NULL, - `rental_id` int(11) DEFAULT NULL, - `amount` decimal(5,2) NOT NULL, - `payment_date` datetime NOT NULL, - `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`payment_id`), - KEY `idx_fk_staff_id` (`staff_id`), - KEY `idx_fk_customer_id` (`customer_id`), - KEY `fk_payment_rental` (`rental_id`), - CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE, - CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, - CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8";s:3:"len";i:940;s:4:"last";i:940;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:212:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`payment`";s:5:"value";s:7:"payment";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`payment_id`";s:5:"value";s:10:"payment_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"smallint";s:5:"value";s:8:"SMALLINT";s:7:"keyword";s:8:"SMALLINT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:40;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:48;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:49;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"unsigned";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:61;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:84;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`customer_id`";s:5:"value";s:11:"customer_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:88;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"smallint";s:5:"value";s:8:"SMALLINT";s:7:"keyword";s:8:"SMALLINT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:102;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:110;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:111;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:112;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"unsigned";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:123;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:131;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`staff_id`";s:5:"value";s:8:"staff_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:135;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"tinyint";s:5:"value";s:7:"TINYINT";s:7:"keyword";s:7:"TINYINT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:146;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:153;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:154;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:155;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:156;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"unsigned";s:5:"value";s:8:"UNSIGNED";s:7:"keyword";s:8:"UNSIGNED";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:157;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:165;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:166;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:174;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:175;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`rental_id`";s:5:"value";s:9:"rental_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:178;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:189;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:190;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:193;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:194;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:196;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:197;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:198;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:205;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:206;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:210;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:211;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`amount`";s:5:"value";s:6:"amount";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:214;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:222;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"decimal";s:5:"value";s:7:"DECIMAL";s:7:"keyword";s:7:"DECIMAL";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:223;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:230;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:231;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:232;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:233;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:234;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:235;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:236;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:244;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:245;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`payment_date`";s:5:"value";s:12:"payment_date";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:248;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:262;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"datetime";s:5:"value";s:8:"datetime";s:7:"keyword";s:8:"DATETIME";s:4:"type";i:1;s:5:"flags";i:9;s:8:"position";i:263;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:271;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:272;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:280;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:281;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`last_update`";s:5:"value";s:11:"last_update";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:284;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:297;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"timestamp";s:5:"value";s:9:"timestamp";s:7:"keyword";s:9:"TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:298;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:307;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:308;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:316;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:317;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:324;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"CURRENT_TIMESTAMP";s:5:"value";s:17:"CURRENT_TIMESTAMP";s:7:"keyword";s:17:"CURRENT_TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:325;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:342;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON UPDATE";s:5:"value";s:9:"ON UPDATE";s:7:"keyword";s:9:"ON UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:343;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:352;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"CURRENT_TIMESTAMP";s:5:"value";s:17:"CURRENT_TIMESTAMP";s:7:"keyword";s:17:"CURRENT_TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:353;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:370;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:371;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:374;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:385;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:386;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`payment_id`";s:5:"value";s:10:"payment_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:387;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:399;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:400;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:401;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:404;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:407;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"`idx_fk_staff_id`";s:5:"value";s:15:"idx_fk_staff_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:408;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:425;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:426;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`staff_id`";s:5:"value";s:8:"staff_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:427;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:437;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:438;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:439;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:442;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:445;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"`idx_fk_customer_id`";s:5:"value";s:18:"idx_fk_customer_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:446;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:466;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:467;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`customer_id`";s:5:"value";s:11:"customer_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:468;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:481;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:482;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:483;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:486;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:489;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:19:"`fk_payment_rental`";s:5:"value";s:17:"fk_payment_rental";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:490;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:509;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:510;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`rental_id`";s:5:"value";s:9:"rental_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:511;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:522;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:523;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:524;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONSTRAINT";s:5:"value";s:10:"CONSTRAINT";s:7:"keyword";s:10:"CONSTRAINT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:527;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:537;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:21:"`fk_payment_customer`";s:5:"value";s:19:"fk_payment_customer";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:538;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:559;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"FOREIGN KEY";s:5:"value";s:11:"FOREIGN KEY";s:7:"keyword";s:11:"FOREIGN KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:560;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:571;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:572;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`customer_id`";s:5:"value";s:11:"customer_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:573;}i:134;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:586;}i:135;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:587;}i:136;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"REFERENCES";s:5:"value";s:10:"REFERENCES";s:7:"keyword";s:10:"REFERENCES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:588;}i:137;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:598;}i:138;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`customer`";s:5:"value";s:8:"customer";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:599;}i:139;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:609;}i:140;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:610;}i:141;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`customer_id`";s:5:"value";s:11:"customer_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:611;}i:142;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:624;}i:143;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:625;}i:144;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON UPDATE";s:5:"value";s:9:"ON UPDATE";s:7:"keyword";s:9:"ON UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:626;}i:145;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:635;}i:146;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";s:7:"keyword";s:7:"CASCADE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:636;}i:147;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:643;}i:148;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:644;}i:149;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONSTRAINT";s:5:"value";s:10:"CONSTRAINT";s:7:"keyword";s:10:"CONSTRAINT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:647;}i:150;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:657;}i:151;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:19:"`fk_payment_rental`";s:5:"value";s:17:"fk_payment_rental";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:658;}i:152;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:677;}i:153;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"FOREIGN KEY";s:5:"value";s:11:"FOREIGN KEY";s:7:"keyword";s:11:"FOREIGN KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:678;}i:154;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:689;}i:155;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:690;}i:156;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`rental_id`";s:5:"value";s:9:"rental_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:691;}i:157;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:702;}i:158;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:703;}i:159;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"REFERENCES";s:5:"value";s:10:"REFERENCES";s:7:"keyword";s:10:"REFERENCES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:704;}i:160;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:714;}i:161;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`rental`";s:5:"value";s:6:"rental";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:715;}i:162;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:723;}i:163;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:724;}i:164;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`rental_id`";s:5:"value";s:9:"rental_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:725;}i:165;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:736;}i:166;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:737;}i:167;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON DELETE";s:5:"value";s:9:"ON DELETE";s:7:"keyword";s:9:"ON DELETE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:738;}i:168;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:747;}i:169;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"SET NULL";s:5:"value";s:8:"SET NULL";s:7:"keyword";s:8:"SET NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:748;}i:170;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:756;}i:171;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON UPDATE";s:5:"value";s:9:"ON UPDATE";s:7:"keyword";s:9:"ON UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:757;}i:172;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:766;}i:173;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";s:7:"keyword";s:7:"CASCADE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:767;}i:174;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:774;}i:175;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:775;}i:176;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONSTRAINT";s:5:"value";s:10:"CONSTRAINT";s:7:"keyword";s:10:"CONSTRAINT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:778;}i:177;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:788;}i:178;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`fk_payment_staff`";s:5:"value";s:16:"fk_payment_staff";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:789;}i:179;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:807;}i:180;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"FOREIGN KEY";s:5:"value";s:11:"FOREIGN KEY";s:7:"keyword";s:11:"FOREIGN KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:808;}i:181;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:819;}i:182;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:820;}i:183;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`staff_id`";s:5:"value";s:8:"staff_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:821;}i:184;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:831;}i:185;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:832;}i:186;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"REFERENCES";s:5:"value";s:10:"REFERENCES";s:7:"keyword";s:10:"REFERENCES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:833;}i:187;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:843;}i:188;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`staff`";s:5:"value";s:5:"staff";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:844;}i:189;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:851;}i:190;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:852;}i:191;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`staff_id`";s:5:"value";s:8:"staff_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:853;}i:192;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:863;}i:193;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:864;}i:194;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON UPDATE";s:5:"value";s:9:"ON UPDATE";s:7:"keyword";s:9:"ON UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:865;}i:195;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:874;}i:196;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";s:7:"keyword";s:7:"CASCADE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:875;}i:197;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:882;}i:198;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:883;}i:199;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:884;}i:200;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:885;}i:201;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:891;}i:202;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:892;}i:203;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:898;}i:204;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:899;}i:205;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:913;}i:206;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"16050";s:5:"value";i:16050;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:914;}i:207;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:919;}i:208;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:920;}i:209;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:935;}i:210;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"utf8";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:936;}i:211;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:212;s:3:"idx";i:212;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"payment";s:6:"column";N;s:4:"expr";s:9:"`payment`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}i:2;a:4:{s:4:"name";s:14:"AUTO_INCREMENT";s:6:"equals";b:1;s:4:"expr";s:5:"16050";s:5:"value";s:5:"16050";}i:4;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:4:"utf8";s:5:"value";s:4:"utf8";}}}s:6:"fields";a:14:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:10:"payment_id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:8:"SMALLINT";s:10:"parameters";a:1:{i:0;s:1:"5";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:4;s:8:"UNSIGNED";}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:8:"NOT NULL";i:3;s:14:"AUTO_INCREMENT";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:11:"customer_id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:8:"SMALLINT";s:10:"parameters";a:1:{i:0;s:1:"5";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:4;s:8:"UNSIGNED";}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:2;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:8:"staff_id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"TINYINT";s:10:"parameters";a:1:{i:0;s:1:"3";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:4;s:8:"UNSIGNED";}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:3;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:9:"rental_id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"NULL";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"NULL";}}}}i:4;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:6:"amount";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"DECIMAL";s:10:"parameters";a:2:{i:0;s:1:"5";i:1;s:1:"2";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:5;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:12:"payment_date";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:8:"DATETIME";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:6;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:11:"last_update";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:9:"TIMESTAMP";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:17:"CURRENT_TIMESTAMP";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:17:"CURRENT_TIMESTAMP";}i:7;a:4:{s:4:"name";s:9:"ON UPDATE";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:17:"CURRENT_TIMESTAMP";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:17:"CURRENT_TIMESTAMP";}}}}i:7;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:10:"payment_id";}}s:4:"type";s:11:"PRIMARY KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:8;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";s:15:"idx_fk_staff_id";s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:8:"staff_id";}}s:4:"type";s:3:"KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:9;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";s:18:"idx_fk_customer_id";s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:11:"customer_id";}}s:4:"type";s:3:"KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:10;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";s:17:"fk_payment_rental";s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:9:"rental_id";}}s:4:"type";s:3:"KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}i:11;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:19:"fk_payment_customer";s:12:"isConstraint";b:1;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:11:"customer_id";}}s:4:"type";s:11:"FOREIGN KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";O:41:"PhpMyAdmin\SqlParser\Components\Reference":3:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"customer";s:6:"column";N;s:4:"expr";s:10:"`customer`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:11:"customer_id";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:9:"ON UPDATE";s:6:"equals";b:0;s:4:"expr";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";}}}}s:7:"options";N;}i:12;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:17:"fk_payment_rental";s:12:"isConstraint";b:1;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:9:"rental_id";}}s:4:"type";s:11:"FOREIGN KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";O:41:"PhpMyAdmin\SqlParser\Components\Reference":3:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"rental";s:6:"column";N;s:4:"expr";s:8:"`rental`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:9:"rental_id";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:2;a:4:{s:4:"name";s:9:"ON DELETE";s:6:"equals";b:0;s:4:"expr";s:8:"SET NULL";s:5:"value";s:8:"SET NULL";}i:3;a:4:{s:4:"name";s:9:"ON UPDATE";s:6:"equals";b:0;s:4:"expr";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";}}}}s:7:"options";N;}i:13;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:16:"fk_payment_staff";s:12:"isConstraint";b:1;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:8:"staff_id";}}s:4:"type";s:11:"FOREIGN KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";O:41:"PhpMyAdmin\SqlParser\Components\Reference":3:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"staff";s:6:"column";N;s:4:"expr";s:7:"`staff`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:8:"staff_id";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:9:"ON UPDATE";s:6:"equals";b:0;s:4:"expr";s:7:"CASCADE";s:5:"value";s:7:"CASCADE";}}}}s:7:"options";N;}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:211;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `payment` (\n `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,\n `customer_id` smallint(5) unsigned NOT NULL,\n `staff_id` tinyint(3) unsigned NOT NULL,\n `rental_id` int(11) DEFAULT NULL,\n `amount` decimal(5,2) NOT NULL,\n `payment_date` datetime NOT NULL,\n `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n PRIMARY KEY (`payment_id`),\n KEY `idx_fk_staff_id` (`staff_id`),\n KEY `idx_fk_customer_id` (`customer_id`),\n KEY `fk_payment_rental` (`rental_id`),\n CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,\n CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE,\n CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE\n) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `payment` (\n `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,\n `customer_id` smallint(5) unsigned NOT NULL,\n `staff_id` tinyint(3) unsigned NOT NULL,\n `rental_id` int(11) DEFAULT NULL,\n `amount` decimal(5,2) NOT NULL,\n `payment_date` datetime NOT NULL,\n `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n PRIMARY KEY (`payment_id`),\n KEY `idx_fk_staff_id` (`staff_id`),\n KEY `idx_fk_customer_id` (`customer_id`),\n KEY `fk_payment_rental` (`rental_id`),\n CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,\n CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE,\n CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE\n) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8", + "len": 940, + "last": 940, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`payment`", + "value": "payment", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`payment_id`", + "value": "payment_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "smallint", + "value": "SMALLINT", + "keyword": "SMALLINT", + "type": 1, + "flags": 11, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "unsigned", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`customer_id`", + "value": "customer_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "smallint", + "value": "SMALLINT", + "keyword": "SMALLINT", + "type": 1, + "flags": 11, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "unsigned", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`staff_id`", + "value": "staff_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tinyint", + "value": "TINYINT", + "keyword": "TINYINT", + "type": 1, + "flags": 11, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "unsigned", + "value": "UNSIGNED", + "keyword": "UNSIGNED", + "type": 1, + "flags": 3, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rental_id`", + "value": "rental_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 193 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 194 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 198 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 205 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 206 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`amount`", + "value": "amount", + "keyword": null, + "type": 8, + "flags": 2, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "decimal", + "value": "DECIMAL", + "keyword": "DECIMAL", + "type": 1, + "flags": 11, + "position": 223 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 230 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 231 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 233 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 234 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 235 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 236 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 245 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`payment_date`", + "value": "payment_date", + "keyword": null, + "type": 8, + "flags": 2, + "position": 248 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 262 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "datetime", + "value": "datetime", + "keyword": "DATETIME", + "type": 1, + "flags": 9, + "position": 263 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 271 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 272 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 280 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 281 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_update`", + "value": "last_update", + "keyword": null, + "type": 8, + "flags": 2, + "position": 284 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 297 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "timestamp", + "value": "timestamp", + "keyword": "TIMESTAMP", + "type": 1, + "flags": 41, + "position": 298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 307 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 308 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 316 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 317 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 324 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CURRENT_TIMESTAMP", + "value": "CURRENT_TIMESTAMP", + "keyword": "CURRENT_TIMESTAMP", + "type": 1, + "flags": 35, + "position": 325 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 342 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON UPDATE", + "value": "ON UPDATE", + "keyword": "ON UPDATE", + "type": 1, + "flags": 7, + "position": 343 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 352 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CURRENT_TIMESTAMP", + "value": "CURRENT_TIMESTAMP", + "keyword": "CURRENT_TIMESTAMP", + "type": 1, + "flags": 35, + "position": 353 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 370 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 371 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 374 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 385 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 386 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`payment_id`", + "value": "payment_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 387 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 399 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 400 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 401 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 404 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 407 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`idx_fk_staff_id`", + "value": "idx_fk_staff_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 408 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 425 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 426 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`staff_id`", + "value": "staff_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 427 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 437 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 438 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 439 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 442 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 445 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`idx_fk_customer_id`", + "value": "idx_fk_customer_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 446 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 466 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 467 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`customer_id`", + "value": "customer_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 468 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 481 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 482 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 483 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 486 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 489 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fk_payment_rental`", + "value": "fk_payment_rental", + "keyword": null, + "type": 8, + "flags": 2, + "position": 490 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 509 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 510 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rental_id`", + "value": "rental_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 511 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 522 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 523 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 524 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONSTRAINT", + "value": "CONSTRAINT", + "keyword": "CONSTRAINT", + "type": 1, + "flags": 3, + "position": 527 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 537 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fk_payment_customer`", + "value": "fk_payment_customer", + "keyword": null, + "type": 8, + "flags": 2, + "position": 538 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 559 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOREIGN KEY", + "value": "FOREIGN KEY", + "keyword": "FOREIGN KEY", + "type": 1, + "flags": 23, + "position": 560 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 571 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 572 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`customer_id`", + "value": "customer_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 573 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 586 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 587 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REFERENCES", + "value": "REFERENCES", + "keyword": "REFERENCES", + "type": 1, + "flags": 3, + "position": 588 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 598 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`customer`", + "value": "customer", + "keyword": null, + "type": 8, + "flags": 2, + "position": 599 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 609 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 610 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`customer_id`", + "value": "customer_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 611 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 624 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 625 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON UPDATE", + "value": "ON UPDATE", + "keyword": "ON UPDATE", + "type": 1, + "flags": 7, + "position": 626 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 635 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CASCADE", + "value": "CASCADE", + "keyword": "CASCADE", + "type": 1, + "flags": 3, + "position": 636 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 643 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 644 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONSTRAINT", + "value": "CONSTRAINT", + "keyword": "CONSTRAINT", + "type": 1, + "flags": 3, + "position": 647 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 657 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fk_payment_rental`", + "value": "fk_payment_rental", + "keyword": null, + "type": 8, + "flags": 2, + "position": 658 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 677 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOREIGN KEY", + "value": "FOREIGN KEY", + "keyword": "FOREIGN KEY", + "type": 1, + "flags": 23, + "position": 678 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 689 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 690 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rental_id`", + "value": "rental_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 691 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 702 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 703 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REFERENCES", + "value": "REFERENCES", + "keyword": "REFERENCES", + "type": 1, + "flags": 3, + "position": 704 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 714 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rental`", + "value": "rental", + "keyword": null, + "type": 8, + "flags": 2, + "position": 715 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 723 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 724 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rental_id`", + "value": "rental_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 725 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 736 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 737 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON DELETE", + "value": "ON DELETE", + "keyword": "ON DELETE", + "type": 1, + "flags": 7, + "position": 738 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 747 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET NULL", + "value": "SET NULL", + "keyword": "SET NULL", + "type": 1, + "flags": 7, + "position": 748 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 756 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON UPDATE", + "value": "ON UPDATE", + "keyword": "ON UPDATE", + "type": 1, + "flags": 7, + "position": 757 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 766 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CASCADE", + "value": "CASCADE", + "keyword": "CASCADE", + "type": 1, + "flags": 3, + "position": 767 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 774 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 775 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONSTRAINT", + "value": "CONSTRAINT", + "keyword": "CONSTRAINT", + "type": 1, + "flags": 3, + "position": 778 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 788 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fk_payment_staff`", + "value": "fk_payment_staff", + "keyword": null, + "type": 8, + "flags": 2, + "position": 789 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 807 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOREIGN KEY", + "value": "FOREIGN KEY", + "keyword": "FOREIGN KEY", + "type": 1, + "flags": 23, + "position": 808 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 819 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 820 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`staff_id`", + "value": "staff_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 821 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 831 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 832 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REFERENCES", + "value": "REFERENCES", + "keyword": "REFERENCES", + "type": 1, + "flags": 3, + "position": 833 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 843 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`staff`", + "value": "staff", + "keyword": null, + "type": 8, + "flags": 2, + "position": 844 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 851 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 852 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`staff_id`", + "value": "staff_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 853 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 863 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 864 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON UPDATE", + "value": "ON UPDATE", + "keyword": "ON UPDATE", + "type": 1, + "flags": 7, + "position": 865 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 874 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CASCADE", + "value": "CASCADE", + "keyword": "CASCADE", + "type": 1, + "flags": 3, + "position": 875 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 882 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 883 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 884 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 885 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 891 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 892 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 898 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 899 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 913 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "16050", + "value": 16050, + "keyword": null, + "type": 6, + "flags": 0, + "position": 914 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 919 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 920 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 935 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "utf8", + "value": "utf8", + "keyword": null, + "type": 0, + "flags": 0, + "position": 936 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 212, + "idx": 212 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "payment", + "column": null, + "expr": "`payment`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + }, + "2": { + "name": "AUTO_INCREMENT", + "equals": true, + "expr": "16050", + "value": "16050" + }, + "4": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "utf8", + "value": "utf8" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "payment_id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "SMALLINT", + "parameters": [ + "5" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "4": "UNSIGNED" + } + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "3": "AUTO_INCREMENT" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "customer_id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "SMALLINT", + "parameters": [ + "5" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "4": "UNSIGNED" + } + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "staff_id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "TINYINT", + "parameters": [ + "3" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "4": "UNSIGNED" + } + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "rental_id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "NULL", + "alias": null, + "function": null, + "subquery": null + }, + "value": "NULL" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "amount", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "DECIMAL", + "parameters": [ + "5", + "2" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "payment_date", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "DATETIME", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "last_update", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "TIMESTAMP", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "CURRENT_TIMESTAMP", + "alias": null, + "function": null, + "subquery": null + }, + "value": "CURRENT_TIMESTAMP" + }, + "7": { + "name": "ON UPDATE", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "CURRENT_TIMESTAMP", + "alias": null, + "function": null, + "subquery": null + }, + "value": "CURRENT_TIMESTAMP" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "payment_id" + } + ], + "type": "PRIMARY KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": "idx_fk_staff_id", + "columns": [ + { + "name": "staff_id" + } + ], + "type": "KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": "idx_fk_customer_id", + "columns": [ + { + "name": "customer_id" + } + ], + "type": "KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": "fk_payment_rental", + "columns": [ + { + "name": "rental_id" + } + ], + "type": "KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "fk_payment_customer", + "isConstraint": true, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "customer_id" + } + ], + "type": "FOREIGN KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Reference", + "REFERENCES_OPTIONS": { + "MATCH": [ + 1, + "var" + ], + "ON DELETE": [ + 2, + "var" + ], + "ON UPDATE": [ + 3, + "var" + ] + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "customer", + "column": null, + "expr": "`customer`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "customer_id" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "ON UPDATE", + "equals": false, + "expr": "CASCADE", + "value": "CASCADE" + } + } + } + }, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "fk_payment_rental", + "isConstraint": true, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "rental_id" + } + ], + "type": "FOREIGN KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Reference", + "REFERENCES_OPTIONS": { + "MATCH": [ + 1, + "var" + ], + "ON DELETE": [ + 2, + "var" + ], + "ON UPDATE": [ + 3, + "var" + ] + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "rental", + "column": null, + "expr": "`rental`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "rental_id" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "ON DELETE", + "equals": false, + "expr": "SET NULL", + "value": "SET NULL" + }, + "3": { + "name": "ON UPDATE", + "equals": false, + "expr": "CASCADE", + "value": "CASCADE" + } + } + } + }, + "options": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "fk_payment_staff", + "isConstraint": true, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "staff_id" + } + ], + "type": "FOREIGN KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Reference", + "REFERENCES_OPTIONS": { + "MATCH": [ + 1, + "var" + ], + "ON DELETE": [ + 2, + "var" + ], + "ON UPDATE": [ + 3, + "var" + ] + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "staff", + "column": null, + "expr": "`staff`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "staff_id" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "ON UPDATE", + "equals": false, + "expr": "CASCADE", + "value": "CASCADE" + } + } + } + }, + "options": null + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 211 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable3.out b/tests/data/parser/parseCreateTable3.out index e05e26365..0afce58ca 100644 --- a/tests/data/parser/parseCreateTable3.out +++ b/tests/data/parser/parseCreateTable3.out @@ -1,16 +1,1587 @@ -a:4:{s:5:"query";s:139:"CREATE TABLE table1 ( - a INT NOT NULL, - b VARCHAR(32), - c INT AS (a mod 10) VIRTUAL, - d VARCHAR(5) AS (left(b,5)) PERSISTENT -);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:139:"CREATE TABLE table1 ( - a INT NOT NULL, - b VARCHAR(32), - c INT AS (a mod 10) VIRTUAL, - d VARCHAR(5) AS (left(b,5)) PERSISTENT -);";s:3:"len";i:139;s:4:"last";i:139;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:63:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:46;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:48;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"32";s:5:"value";i:32;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:56;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:58;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:59;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:67;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:74;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"mod";s:5:"value";s:3:"MOD";s:7:"keyword";s:3:"MOD";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:77;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:81;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VIRTUAL";s:5:"value";s:7:"VIRTUAL";s:7:"keyword";s:7:"VIRTUAL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:85;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:92;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"d";s:5:"value";s:1:"d";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:98;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:100;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:107;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:108;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:109;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:111;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:114;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"left";s:5:"value";s:4:"LEFT";s:7:"keyword";s:4:"LEFT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:115;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:119;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:120;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:121;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"5";s:5:"value";i:5;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:122;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:123;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:124;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"PERSISTENT";s:5:"value";s:10:"PERSISTENT";s:7:"keyword";s:10:"PERSISTENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:126;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:136;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:137;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:138;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:63;s:3:"idx";i:63;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:4:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:1:"a";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:1:"b";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:2:"32";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:2;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:1:"c";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:9;a:4:{s:4:"name";s:2:"AS";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:10:"(a mod 10)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:10:"(a mod 10)";}i:10;s:7:"VIRTUAL";}}}i:3;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:1:"d";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:1:"5";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:9;a:4:{s:4:"name";s:2:"AS";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:11:"(left(b,5))";s:5:"alias";N;s:8:"function";s:4:"LEFT";s:8:"subquery";N;}s:5:"value";s:11:"(left(b,5))";}i:11;s:10:"PERSISTENT";}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:61;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE table1 (\n a INT NOT NULL,\n b VARCHAR(32),\n c INT AS (a mod 10) VIRTUAL,\n d VARCHAR(5) AS (left(b,5)) PERSISTENT\n);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE table1 (\n a INT NOT NULL,\n b VARCHAR(32),\n c INT AS (a mod 10) VIRTUAL,\n d VARCHAR(5) AS (left(b,5)) PERSISTENT\n);", + "len": 139, + "last": 139, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "32", + "value": 32, + "keyword": null, + "type": 6, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mod", + "value": "MOD", + "keyword": "MOD", + "type": 1, + "flags": 35, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIRTUAL", + "value": "VIRTUAL", + "keyword": "VIRTUAL", + "type": 1, + "flags": 3, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "d", + "value": "d", + "keyword": null, + "type": 0, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left", + "value": "LEFT", + "keyword": "LEFT", + "type": 1, + "flags": 35, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "5", + "value": 5, + "keyword": null, + "type": 6, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PERSISTENT", + "value": "PERSISTENT", + "keyword": "PERSISTENT", + "type": 1, + "flags": 1, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 63, + "idx": 63 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "a", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "b", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "32" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "c", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "9": { + "name": "AS", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(a mod 10)", + "alias": null, + "function": null, + "subquery": null + }, + "value": "(a mod 10)" + }, + "10": "VIRTUAL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "d", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "5" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "9": { + "name": "AS", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(left(b,5))", + "alias": null, + "function": "LEFT", + "subquery": null + }, + "value": "(left(b,5))" + }, + "11": "PERSISTENT" + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 61 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable4.out b/tests/data/parser/parseCreateTable4.out index 0d89a3009..c7ce133aa 100644 --- a/tests/data/parser/parseCreateTable4.out +++ b/tests/data/parser/parseCreateTable4.out @@ -1,61 +1,2346 @@ -a:4:{s:5:"query";s:408:"CREATE TABLE ts(id INT, purchased DATE) -PARTITION BY /* comment */ RANGE(YEAR(purchased)) -PARTITIONS 3 -SUBPARTITION BY HASH(TO_DAYS(purchased)) -SUBPARTITIONS 2( -PARTITION p0 -VALUES LESS THAN(1990)( - SUBPARTITION s0, - SUBPARTITION s1 -), -PARTITION p1 -VALUES LESS THAN(2000)( - SUBPARTITION s2, - SUBPARTITION s3 -), -PARTITION p2 -VALUES LESS THAN MAXVALUE( - SUBPARTITION s4, - SUBPARTITION s5 -) -);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:408:"CREATE TABLE ts(id INT, purchased DATE) -PARTITION BY /* comment */ RANGE(YEAR(purchased)) -PARTITIONS 3 -SUBPARTITION BY HASH(TO_DAYS(purchased)) -SUBPARTITIONS 2( -PARTITION p0 -VALUES LESS THAN(1990)( - SUBPARTITION s0, - SUBPARTITION s1 -), -PARTITION p1 -VALUES LESS THAN(2000)( - SUBPARTITION s2, - SUBPARTITION s3 -), -PARTITION p2 -VALUES LESS THAN MAXVALUE( - SUBPARTITION s4, - SUBPARTITION s5 -) -);";s:3:"len";i:408;s:4:"last";i:408;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:120:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ts";s:5:"value";s:2:"ts";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"purchased";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:24;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DATE";s:5:"value";s:4:"DATE";s:7:"keyword";s:4:"DATE";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"PARTITION BY";s:5:"value";s:12:"PARTITION BY";s:7:"keyword";s:12:"PARTITION BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:40;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"/* comment */";s:5:"value";s:13:"/* comment */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:53;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"RANGE";s:5:"value";s:5:"RANGE";s:7:"keyword";s:5:"RANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:67;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"YEAR";s:5:"value";s:4:"YEAR";s:7:"keyword";s:4:"YEAR";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:77;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"purchased";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:87;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"PARTITIONS";s:5:"value";s:10:"PARTITIONS";s:7:"keyword";s:10:"PARTITIONS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:90;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:101;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"SUBPARTITION BY";s:5:"value";s:15:"SUBPARTITION BY";s:7:"keyword";s:15:"SUBPARTITION BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:103;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"HASH";s:5:"value";s:4:"HASH";s:7:"keyword";s:4:"HASH";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:119;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:123;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"TO_DAYS";s:5:"value";s:7:"TO_DAYS";s:7:"keyword";s:7:"TO_DAYS";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:124;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:131;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"purchased";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:132;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:141;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:142;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:143;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"SUBPARTITIONS";s:5:"value";s:13:"SUBPARTITIONS";s:7:"keyword";s:13:"SUBPARTITIONS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:144;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:158;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:159;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:161;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:170;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p0";s:5:"value";s:2:"p0";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:171;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:173;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:174;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:180;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:181;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:190;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"1990";s:5:"value";i:1990;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:191;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:195;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:196;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:197;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:202;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:214;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s0";s:5:"value";s:2:"s0";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:215;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:217;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:218;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:223;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:235;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s1";s:5:"value";s:2:"s1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:236;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:238;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:239;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:240;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:241;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:242;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:251;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:252;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:254;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:255;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:261;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:262;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:271;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2000";s:5:"value";i:2000;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:272;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:276;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:277;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:278;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:283;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:295;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s2";s:5:"value";s:2:"s2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:296;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:298;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:299;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:304;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:316;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s3";s:5:"value";s:2:"s3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:317;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:319;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:320;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:321;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:322;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:323;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:332;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p2";s:5:"value";s:2:"p2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:333;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:335;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:336;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:342;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:343;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:352;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"MAXVALUE";s:5:"value";s:8:"MAXVALUE";s:7:"keyword";s:8:"MAXVALUE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:353;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:361;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:362;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:367;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:379;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s4";s:5:"value";s:2:"s4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:380;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:382;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:383;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:388;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:400;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s5";s:5:"value";s:2:"s5";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:401;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:403;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:404;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:405;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:406;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:407;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:120;s:3:"idx";i:120;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"ts";s:6:"column";N;s:4:"expr";s:2:"ts";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:2:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:9:"purchased";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:4:"DATE";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";s:22:"RANGE(YEAR(purchased))";s:13:"partitionsNum";i:3;s:14:"subpartitionBy";s:24:"HASH(TO_DAYS(purchased))";s:16:"subpartitionsNum";i:2;s:10:"partitions";a:3:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p0";s:4:"type";s:9:"LESS THAN";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:6:"(1990)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s0";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s1";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p1";s:4:"type";s:9:"LESS THAN";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:6:"(2000)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s2";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s3";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:2;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p2";s:4:"type";s:9:"LESS THAN";s:4:"expr";s:8:"MAXVALUE";s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s4";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s5";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:117;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE ts(id INT, purchased DATE)\nPARTITION BY \/* comment *\/ RANGE(YEAR(purchased))\nPARTITIONS 3\nSUBPARTITION BY HASH(TO_DAYS(purchased))\nSUBPARTITIONS 2(\nPARTITION p0\nVALUES LESS THAN(1990)(\n SUBPARTITION s0,\n SUBPARTITION s1\n),\nPARTITION p1\nVALUES LESS THAN(2000)(\n SUBPARTITION s2,\n SUBPARTITION s3\n),\nPARTITION p2\nVALUES LESS THAN MAXVALUE(\n SUBPARTITION s4,\n SUBPARTITION s5\n)\n);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE ts(id INT, purchased DATE)\nPARTITION BY \/* comment *\/ RANGE(YEAR(purchased))\nPARTITIONS 3\nSUBPARTITION BY HASH(TO_DAYS(purchased))\nSUBPARTITIONS 2(\nPARTITION p0\nVALUES LESS THAN(1990)(\n SUBPARTITION s0,\n SUBPARTITION s1\n),\nPARTITION p1\nVALUES LESS THAN(2000)(\n SUBPARTITION s2,\n SUBPARTITION s3\n),\nPARTITION p2\nVALUES LESS THAN MAXVALUE(\n SUBPARTITION s4,\n SUBPARTITION s5\n)\n);", + "len": 408, + "last": 408, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ts", + "value": "ts", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purchased", + "value": "purchased", + "keyword": null, + "type": 0, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATE", + "value": "DATE", + "keyword": "DATE", + "type": 1, + "flags": 41, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION BY", + "value": "PARTITION BY", + "keyword": "PARTITION BY", + "type": 1, + "flags": 7, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* comment *\/", + "value": "\/* comment *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RANGE", + "value": "RANGE", + "keyword": "RANGE", + "type": 1, + "flags": 3, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "YEAR", + "value": "YEAR", + "keyword": "YEAR", + "type": 1, + "flags": 41, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purchased", + "value": "purchased", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITIONS", + "value": "PARTITIONS", + "keyword": "PARTITIONS", + "type": 1, + "flags": 1, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION BY", + "value": "SUBPARTITION BY", + "keyword": "SUBPARTITION BY", + "type": 1, + "flags": 7, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "HASH", + "value": "HASH", + "keyword": "HASH", + "type": 1, + "flags": 1, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO_DAYS", + "value": "TO_DAYS", + "keyword": "TO_DAYS", + "type": 1, + "flags": 33, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purchased", + "value": "purchased", + "keyword": null, + "type": 0, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITIONS", + "value": "SUBPARTITIONS", + "keyword": "SUBPARTITIONS", + "type": 1, + "flags": 1, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p0", + "value": "p0", + "keyword": null, + "type": 0, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1990", + "value": 1990, + "keyword": null, + "type": 6, + "flags": 0, + "position": 191 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s0", + "value": "s0", + "keyword": null, + "type": 0, + "flags": 0, + "position": 215 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 217 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 223 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 235 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s1", + "value": "s1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 236 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 238 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 239 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 240 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 242 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 251 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 255 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 261 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 262 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 271 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2000", + "value": 2000, + "keyword": null, + "type": 6, + "flags": 0, + "position": 272 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 276 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 277 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 278 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 283 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 295 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s2", + "value": "s2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 296 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 299 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 304 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 316 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s3", + "value": "s3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 317 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 319 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 320 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 321 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 322 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 323 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 332 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p2", + "value": "p2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 333 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 335 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 336 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 342 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 343 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 352 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MAXVALUE", + "value": "MAXVALUE", + "keyword": "MAXVALUE", + "type": 1, + "flags": 3, + "position": 353 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 361 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 362 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 367 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 379 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s4", + "value": "s4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 380 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 382 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 383 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 388 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 400 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s5", + "value": "s5", + "keyword": null, + "type": 0, + "flags": 0, + "position": 401 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 403 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 404 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 405 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 406 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 407 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 120, + "idx": 120 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "ts", + "column": null, + "expr": "ts", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "purchased", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "DATE", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "select": null, + "like": null, + "partitionBy": "RANGE(YEAR(purchased))", + "partitionsNum": 3, + "subpartitionBy": "HASH(TO_DAYS(purchased))", + "subpartitionsNum": 2, + "partitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p0", + "type": "LESS THAN", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(1990)", + "alias": null, + "function": null, + "subquery": null + }, + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s0", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s1", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p1", + "type": "LESS THAN", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(2000)", + "alias": null, + "function": null, + "subquery": null + }, + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s2", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s3", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p2", + "type": "LESS THAN", + "expr": "MAXVALUE", + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s4", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s5", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 117 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable5.out b/tests/data/parser/parseCreateTable5.out index 53064d7e9..4ec0e2d8e 100644 --- a/tests/data/parser/parseCreateTable5.out +++ b/tests/data/parser/parseCreateTable5.out @@ -1 +1,886 @@ -a:4:{s:5:"query";s:56:"CREATE TABLE new_table (`INT` VARCHAR(50) DEFAULT NULL);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:56:"CREATE TABLE new_table (`INT` VARCHAR(50) DEFAULT NULL);";s:3:"len";i:56;s:4:"last";i:56;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:20:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"new_table";s:5:"value";s:9:"new_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`INT`";s:5:"value";s:3:"INT";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"50";s:5:"value";i:50;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:38;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:55;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:20;s:3:"idx";i:20;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"new_table";s:6:"column";N;s:4:"expr";s:9:"new_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:3:"INT";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:2:"50";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"NULL";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"NULL";}}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_table (`INT` VARCHAR(50) DEFAULT NULL);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_table (`INT` VARCHAR(50) DEFAULT NULL);", + "len": 56, + "last": 56, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_table", + "value": "new_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`INT`", + "value": "INT", + "keyword": null, + "type": 8, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "50", + "value": 50, + "keyword": null, + "type": 6, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 20, + "idx": 20 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_table", + "column": null, + "expr": "new_table", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "INT", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "50" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "NULL", + "alias": null, + "function": null, + "subquery": null + }, + "value": "NULL" + } + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable6.out b/tests/data/parser/parseCreateTable6.out index b8e32b565..dec860db7 100644 --- a/tests/data/parser/parseCreateTable6.out +++ b/tests/data/parser/parseCreateTable6.out @@ -1,4 +1,895 @@ -a:4:{s:5:"query";s:58:"CREATE TABLE new_table (ACTION VARCHAR(50) DEFAULT NULL); -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:58:"CREATE TABLE new_table (ACTION VARCHAR(50) DEFAULT NULL); -";s:3:"len";i:58;s:4:"last";i:58;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"new_table";s:5:"value";s:9:"new_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ACTION";s:5:"value";s:6:"ACTION";s:7:"keyword";s:6:"ACTION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:31;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"50";s:5:"value";i:50;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:39;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:43;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:51;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:56;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"new_table";s:6:"column";N;s:4:"expr";s:9:"new_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:6:"ACTION";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"VARCHAR";s:10:"parameters";a:1:{i:0;s:2:"50";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"NULL";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"NULL";}}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_table (ACTION VARCHAR(50) DEFAULT NULL);\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_table (ACTION VARCHAR(50) DEFAULT NULL);\n", + "len": 58, + "last": 58, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_table", + "value": "new_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ACTION", + "value": "ACTION", + "keyword": "ACTION", + "type": 1, + "flags": 1, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "50", + "value": 50, + "keyword": null, + "type": 6, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_table", + "column": null, + "expr": "new_table", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "ACTION", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "VARCHAR", + "parameters": [ + "50" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "NULL", + "alias": null, + "function": null, + "subquery": null + }, + "value": "NULL" + } + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTable7.out b/tests/data/parser/parseCreateTable7.out index 58bb92370..c6adc248f 100644 --- a/tests/data/parser/parseCreateTable7.out +++ b/tests/data/parser/parseCreateTable7.out @@ -1,61 +1,2866 @@ -a:4:{s:5:"query";s:518:"CREATE TABLE `ts` ( - `id` int(11) DEFAULT NULL, - `purchased` date DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 -PARTITION BY RANGE (YEAR(purchased)) -SUBPARTITION BY HASH (TO_DAYS(purchased)) -( -PARTITION p0 VALUES LESS THAN (1990) ( -SUBPARTITION s0 ENGINE=InnoDB, -SUBPARTITION s1 ENGINE=InnoDB -), -PARTITION p1 VALUES LESS THAN (2000) ( -SUBPARTITION s2 ENGINE=InnoDB, -SUBPARTITION s3 ENGINE=InnoDB -), -PARTITION p2 VALUES LESS THAN MAXVALUE ( -SUBPARTITION s4 ENGINE=InnoDB, -SUBPARTITION s5 ENGINE=InnoDB -) -); -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:518:"CREATE TABLE `ts` ( - `id` int(11) DEFAULT NULL, - `purchased` date DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 -PARTITION BY RANGE (YEAR(purchased)) -SUBPARTITION BY HASH (TO_DAYS(purchased)) -( -PARTITION p0 VALUES LESS THAN (1990) ( -SUBPARTITION s0 ENGINE=InnoDB, -SUBPARTITION s1 ENGINE=InnoDB -), -PARTITION p1 VALUES LESS THAN (2000) ( -SUBPARTITION s2 ENGINE=InnoDB, -SUBPARTITION s3 ENGINE=InnoDB -), -PARTITION p2 VALUES LESS THAN MAXVALUE ( -SUBPARTITION s4 ENGINE=InnoDB, -SUBPARTITION s5 ENGINE=InnoDB -) -); -";s:3:"len";i:518;s:4:"last";i:518;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:165:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`ts`";s:5:"value";s:2:"ts";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:35;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`purchased`";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:51;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"date";s:5:"value";s:4:"date";s:7:"keyword";s:4:"DATE";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:63;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:68;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:81;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:83;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:90;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:97;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:112;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"utf8mb4";s:5:"value";s:7:"utf8mb4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:113;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"PARTITION BY";s:5:"value";s:12:"PARTITION BY";s:7:"keyword";s:12:"PARTITION BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:121;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"RANGE";s:5:"value";s:5:"RANGE";s:7:"keyword";s:5:"RANGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:134;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:140;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"YEAR";s:5:"value";s:4:"YEAR";s:7:"keyword";s:4:"YEAR";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:141;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:145;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"purchased";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:146;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:155;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:156;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"SUBPARTITION BY";s:5:"value";s:15:"SUBPARTITION BY";s:7:"keyword";s:15:"SUBPARTITION BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:158;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:173;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"HASH";s:5:"value";s:4:"HASH";s:7:"keyword";s:4:"HASH";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:174;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:178;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:179;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"TO_DAYS";s:5:"value";s:7:"TO_DAYS";s:7:"keyword";s:7:"TO_DAYS";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:180;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:187;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"purchased";s:5:"value";s:9:"purchased";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:188;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:197;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:198;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:199;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:200;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:201;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:202;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:211;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p0";s:5:"value";s:2:"p0";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:212;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:214;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:215;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:221;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:222;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:231;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:232;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"1990";s:5:"value";i:1990;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:233;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:237;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:238;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:240;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:241;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:242;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:254;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s0";s:5:"value";s:2:"s0";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:255;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:257;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:258;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:264;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:265;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:271;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:272;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:273;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:285;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s1";s:5:"value";s:2:"s1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:286;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:288;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:289;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:295;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:296;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:302;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:303;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:304;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:305;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:306;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:315;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:316;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:318;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:319;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:325;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:326;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:335;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:336;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"2000";s:5:"value";i:2000;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:337;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:341;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:342;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:344;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:345;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:346;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:358;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s2";s:5:"value";s:2:"s2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:359;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:361;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:362;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:368;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:369;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:375;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:376;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:377;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:389;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s3";s:5:"value";s:2:"s3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:390;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:392;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:393;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:399;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:400;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:406;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:407;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:408;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:409;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:410;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:419;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p2";s:5:"value";s:2:"p2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:420;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:422;}i:134;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:423;}i:135;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:429;}i:136;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LESS THAN";s:5:"value";s:9:"LESS THAN";s:7:"keyword";s:9:"LESS THAN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:430;}i:137;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:439;}i:138;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"MAXVALUE";s:5:"value";s:8:"MAXVALUE";s:7:"keyword";s:8:"MAXVALUE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:440;}i:139;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:448;}i:140;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:450;}i:141;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:451;}i:142;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:452;}i:143;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:464;}i:144;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s4";s:5:"value";s:2:"s4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:465;}i:145;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:467;}i:146;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:468;}i:147;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:474;}i:148;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:475;}i:149;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:481;}i:150;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:482;}i:151;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SUBPARTITION";s:5:"value";s:12:"SUBPARTITION";s:7:"keyword";s:12:"SUBPARTITION";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:483;}i:152;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:495;}i:153;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"s5";s:5:"value";s:2:"s5";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:496;}i:154;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:498;}i:155;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:499;}i:156;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:505;}i:157;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:506;}i:158;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:512;}i:159;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:513;}i:160;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:514;}i:161;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:515;}i:162;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:516;}i:163;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:517;}i:164;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:165;s:3:"idx";i:165;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"ts";s:6:"column";N;s:4:"expr";s:4:"`ts`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}i:4;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:7:"utf8mb4";s:5:"value";s:7:"utf8mb4";}}}s:6:"fields";a:2:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"NULL";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"NULL";}}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:9:"purchased";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:4:"DATE";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"NULL";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"NULL";}}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";s:23:"RANGE (YEAR(purchased))";s:13:"partitionsNum";N;s:14:"subpartitionBy";s:25:"HASH (TO_DAYS(purchased))";s:16:"subpartitionsNum";N;s:10:"partitions";a:3:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p0";s:4:"type";s:9:"LESS THAN";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:6:"(1990)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s0";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s1";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p1";s:4:"type";s:9:"LESS THAN";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:6:"(2000)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s2";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s3";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}i:2;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:0;s:4:"name";s:2:"p2";s:4:"type";s:9:"LESS THAN";s:4:"expr";s:8:"MAXVALUE";s:13:"subpartitions";a:2:{i:0;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s4";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}i:1;O:51:"PhpMyAdmin\SqlParser\Components\PartitionDefinition":6:{s:14:"isSubpartition";b:1;s:4:"name";s:2:"s5";s:4:"type";N;s:4:"expr";N;s:13:"subpartitions";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:161;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `ts` (\n `id` int(11) DEFAULT NULL,\n `purchased` date DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\nPARTITION BY RANGE (YEAR(purchased))\nSUBPARTITION BY HASH (TO_DAYS(purchased))\n(\nPARTITION p0 VALUES LESS THAN (1990) (\nSUBPARTITION s0 ENGINE=InnoDB,\nSUBPARTITION s1 ENGINE=InnoDB\n),\nPARTITION p1 VALUES LESS THAN (2000) (\nSUBPARTITION s2 ENGINE=InnoDB,\nSUBPARTITION s3 ENGINE=InnoDB\n),\nPARTITION p2 VALUES LESS THAN MAXVALUE (\nSUBPARTITION s4 ENGINE=InnoDB,\nSUBPARTITION s5 ENGINE=InnoDB\n)\n);\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `ts` (\n `id` int(11) DEFAULT NULL,\n `purchased` date DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\nPARTITION BY RANGE (YEAR(purchased))\nSUBPARTITION BY HASH (TO_DAYS(purchased))\n(\nPARTITION p0 VALUES LESS THAN (1990) (\nSUBPARTITION s0 ENGINE=InnoDB,\nSUBPARTITION s1 ENGINE=InnoDB\n),\nPARTITION p1 VALUES LESS THAN (2000) (\nSUBPARTITION s2 ENGINE=InnoDB,\nSUBPARTITION s3 ENGINE=InnoDB\n),\nPARTITION p2 VALUES LESS THAN MAXVALUE (\nSUBPARTITION s4 ENGINE=InnoDB,\nSUBPARTITION s5 ENGINE=InnoDB\n)\n);\n", + "len": 518, + "last": 518, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`ts`", + "value": "ts", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`purchased`", + "value": "purchased", + "keyword": null, + "type": 8, + "flags": 2, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "date", + "value": "date", + "keyword": "DATE", + "type": 1, + "flags": 41, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "utf8mb4", + "value": "utf8mb4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION BY", + "value": "PARTITION BY", + "keyword": "PARTITION BY", + "type": 1, + "flags": 7, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RANGE", + "value": "RANGE", + "keyword": "RANGE", + "type": 1, + "flags": 3, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "YEAR", + "value": "YEAR", + "keyword": "YEAR", + "type": 1, + "flags": 41, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purchased", + "value": "purchased", + "keyword": null, + "type": 0, + "flags": 0, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION BY", + "value": "SUBPARTITION BY", + "keyword": "SUBPARTITION BY", + "type": 1, + "flags": 7, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "HASH", + "value": "HASH", + "keyword": "HASH", + "type": 1, + "flags": 1, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO_DAYS", + "value": "TO_DAYS", + "keyword": "TO_DAYS", + "type": 1, + "flags": 33, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purchased", + "value": "purchased", + "keyword": null, + "type": 0, + "flags": 0, + "position": 188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 197 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 198 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 199 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 200 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p0", + "value": "p0", + "keyword": null, + "type": 0, + "flags": 0, + "position": 212 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 215 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 231 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1990", + "value": 1990, + "keyword": null, + "type": 6, + "flags": 0, + "position": 233 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 237 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 238 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 240 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 241 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 242 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s0", + "value": "s0", + "keyword": null, + "type": 0, + "flags": 0, + "position": 255 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 257 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 258 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 264 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 265 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 271 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 272 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 273 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 285 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s1", + "value": "s1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 286 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 288 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 289 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 295 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 296 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 302 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 303 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 304 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 305 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 306 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 315 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 316 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 318 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 319 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 325 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 326 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 335 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 336 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2000", + "value": 2000, + "keyword": null, + "type": 6, + "flags": 0, + "position": 337 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 341 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 342 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 344 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 345 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 346 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 358 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s2", + "value": "s2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 359 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 361 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 362 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 368 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 369 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 375 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 376 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 377 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 389 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s3", + "value": "s3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 390 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 392 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 393 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 399 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 400 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 406 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 407 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 408 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 409 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 410 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 419 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p2", + "value": "p2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 420 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 422 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 423 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 429 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LESS THAN", + "value": "LESS THAN", + "keyword": "LESS THAN", + "type": 1, + "flags": 7, + "position": 430 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 439 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MAXVALUE", + "value": "MAXVALUE", + "keyword": "MAXVALUE", + "type": 1, + "flags": 3, + "position": 440 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 448 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 450 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 451 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 452 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 464 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s4", + "value": "s4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 465 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 467 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 468 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 474 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 475 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 481 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 482 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUBPARTITION", + "value": "SUBPARTITION", + "keyword": "SUBPARTITION", + "type": 1, + "flags": 1, + "position": 483 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 495 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "s5", + "value": "s5", + "keyword": null, + "type": 0, + "flags": 0, + "position": 496 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 498 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 499 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 505 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 506 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 512 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 513 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 514 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 515 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 516 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 517 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 165, + "idx": 165 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "ts", + "column": null, + "expr": "`ts`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + }, + "4": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "utf8mb4", + "value": "utf8mb4" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "NULL", + "alias": null, + "function": null, + "subquery": null + }, + "value": "NULL" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "purchased", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "DATE", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "NULL", + "alias": null, + "function": null, + "subquery": null + }, + "value": "NULL" + } + } + } + } + ], + "select": null, + "like": null, + "partitionBy": "RANGE (YEAR(purchased))", + "partitionsNum": null, + "subpartitionBy": "HASH (TO_DAYS(purchased))", + "subpartitionsNum": null, + "partitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p0", + "type": "LESS THAN", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(1990)", + "alias": null, + "function": null, + "subquery": null + }, + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s0", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s1", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p1", + "type": "LESS THAN", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(2000)", + "alias": null, + "function": null, + "subquery": null + }, + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s2", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s3", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": false, + "name": "p2", + "type": "LESS THAN", + "expr": "MAXVALUE", + "subpartitions": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s4", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition", + "OPTIONS": { + "STORAGE ENGINE": [ + 1, + "var" + ], + "ENGINE": [ + 1, + "var" + ], + "COMMENT": [ + 2, + "var" + ], + "DATA DIRECTORY": [ + 3, + "var" + ], + "INDEX DIRECTORY": [ + 4, + "var" + ], + "MAX_ROWS": [ + 5, + "var" + ], + "MIN_ROWS": [ + 6, + "var" + ], + "TABLESPACE": [ + 7, + "var" + ], + "NODEGROUP": [ + 8, + "var" + ] + }, + "isSubpartition": true, + "name": "s5", + "type": null, + "expr": null, + "subpartitions": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + } + } + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 161 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableAsSelect.out b/tests/data/parser/parseCreateTableAsSelect.out index 26acdeb64..be4e4ff4a 100644 --- a/tests/data/parser/parseCreateTableAsSelect.out +++ b/tests/data/parser/parseCreateTableAsSelect.out @@ -1,4 +1,948 @@ -a:4:{s:5:"query";s:47:"CREATE TABLE new_tbl AS SELECT * FROM orig_tbl -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:47:"CREATE TABLE new_tbl AS SELECT * FROM orig_tbl -";s:3:"len";i:47;s:4:"last";i:47;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"new_tbl";s:5:"value";s:7:"new_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"orig_tbl";s:5:"value";s:8:"orig_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"new_tbl";s:6:"column";N;s:4:"expr";s:7:"new_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"orig_tbl";s:6:"column";N;s:4:"expr";s:8:"orig_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:8;s:4:"last";i:15;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_tbl AS SELECT * FROM orig_tbl\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_tbl AS SELECT * FROM orig_tbl\n", + "len": 47, + "last": 47, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_tbl", + "value": "new_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "orig_tbl", + "value": "orig_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_tbl", + "column": null, + "expr": "new_tbl", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "orig_tbl", + "column": null, + "expr": "orig_tbl", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 8, + "last": 15 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableErr1.out b/tests/data/parser/parseCreateTableErr1.out index 4d5871cd9..039542f21 100644 --- a/tests/data/parser/parseCreateTableErr1.out +++ b/tests/data/parser/parseCreateTableErr1.out @@ -1,7 +1,880 @@ -a:4:{s:5:"query";s:68:"CREATE TABLE IF NOT EXISTS users ( - `id` UNKNOWN -) ENGINE=InnoDB;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:68:"CREATE TABLE IF NOT EXISTS users ( - `id` UNKNOWN -) ENGINE=InnoDB;";s:3:"len";i:68;s:4:"last";i:68;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"IF NOT EXISTS";s:5:"value";s:13:"IF NOT EXISTS";s:7:"keyword";s:13:"IF NOT EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"UNKNOWN";s:5:"value";s:7:"UNKNOWN";s:7:"keyword";s:7:"UNKNOWN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:54;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:60;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:67;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}s:6:"fields";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:7:"UNKNOWN";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:6;s:5:"TABLE";i:7;s:13:"IF NOT EXISTS";}}s:5:"first";i:0;s:4:"last";i:19;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:23:"Unrecognized data type.";i:1;r:93;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE TABLE IF NOT EXISTS users (\n `id` UNKNOWN\n) ENGINE=InnoDB;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE IF NOT EXISTS users (\n `id` UNKNOWN\n) ENGINE=InnoDB;", + "len": 68, + "last": 68, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF NOT EXISTS", + "value": "IF NOT EXISTS", + "keyword": "IF NOT EXISTS", + "type": 1, + "flags": 7, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNKNOWN", + "value": "UNKNOWN", + "keyword": "UNKNOWN", + "type": 1, + "flags": 1, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "UNKNOWN", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE", + "7": "IF NOT EXISTS" + } + }, + "first": 0, + "last": 19 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized data type.", + { + "@type": "@14" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableErr2.out b/tests/data/parser/parseCreateTableErr2.out index 7e7c7c0ed..cd529bf88 100644 --- a/tests/data/parser/parseCreateTableErr2.out +++ b/tests/data/parser/parseCreateTableErr2.out @@ -1 +1,610 @@ -a:4:{s:5:"query";s:12:"CREATE TABLE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:12:"CREATE TABLE";s:3:"len";i:12;s:4:"last";i:12;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:4:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:4;s:3:"idx";i:4;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";N;s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:0:{}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:36:"The name of the entity was expected.";i:1;r:30;i:2;i:0;}i:1;a:3:{i:0;s:44:"At least one column definition was expected.";i:1;r:23;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE TABLE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE", + "len": 12, + "last": 12, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 4, + "idx": 4 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": null, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "The name of the entity was expected.", + { + "@type": "@5" + }, + 0 + ], + [ + "At least one column definition was expected.", + { + "@type": "@4" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableErr3.out b/tests/data/parser/parseCreateTableErr3.out index 8ddf80b57..91b19919c 100644 --- a/tests/data/parser/parseCreateTableErr3.out +++ b/tests/data/parser/parseCreateTableErr3.out @@ -1 +1,676 @@ -a:4:{s:5:"query";s:32:"CREATE TABLE `table_copy` LIKE ;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:32:"CREATE TABLE `table_copy` LIKE ;";s:3:"len";i:32;s:4:"last";i:32;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`table_copy`";s:5:"value";s:10:"table_copy";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LIKE";s:5:"value";s:4:"LIKE";s:7:"keyword";s:4:"LIKE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"table_copy";s:6:"column";N;s:4:"expr";s:12:"`table_copy`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:26:"A table name was expected.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE TABLE `table_copy` LIKE ;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `table_copy` LIKE ;", + "len": 32, + "last": 32, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`table_copy`", + "value": "table_copy", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIKE", + "value": "LIKE", + "keyword": "LIKE", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table_copy", + "column": null, + "expr": "`table_copy`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A table name was expected.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableErr4.out b/tests/data/parser/parseCreateTableErr4.out index c918f56d8..4362eeac6 100644 --- a/tests/data/parser/parseCreateTableErr4.out +++ b/tests/data/parser/parseCreateTableErr4.out @@ -1 +1,790 @@ -a:4:{s:5:"query";s:54:"CREATE TABLE new_table (INT VARCHAR(50) DEFAULT NULL);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:54:"CREATE TABLE new_table (INT VARCHAR(50) DEFAULT NULL);";s:3:"len";i:54;s:4:"last";i:54;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:20:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"new_table";s:5:"value";s:9:"new_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"50";s:5:"value";i:50;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:53;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:20;s:3:"idx";i:20;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"new_table";s:6:"column";N;s:4:"expr";s:9:"new_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:0:{}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:99:"A symbol name was expected! A reserved keyword can not be used as a column name without backquotes.";i:1;r:58;i:2;i:0;}i:1;a:3:{i:0;s:44:"At least one column definition was expected.";i:1;r:58;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:86;i:2;i:0;}i:3;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_table (INT VARCHAR(50) DEFAULT NULL);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_table (INT VARCHAR(50) DEFAULT NULL);", + "len": 54, + "last": 54, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_table", + "value": "new_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "50", + "value": 50, + "keyword": null, + "type": 6, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 20, + "idx": 20 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_table", + "column": null, + "expr": "new_table", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A symbol name was expected! A reserved keyword can not be used as a column name without backquotes.", + { + "@type": "@9" + }, + 0 + ], + [ + "At least one column definition was expected.", + { + "@type": "@9" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@13" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableErr5.out b/tests/data/parser/parseCreateTableErr5.out index 825c65b42..f0004b074 100644 --- a/tests/data/parser/parseCreateTableErr5.out +++ b/tests/data/parser/parseCreateTableErr5.out @@ -1,4 +1,799 @@ -a:4:{s:5:"query";s:55:"CREATE TABLE new_table (666 VARCHAR(50) DEFAULT NULL); -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:55:"CREATE TABLE new_table (666 VARCHAR(50) DEFAULT NULL); -";s:3:"len";i:55;s:4:"last";i:55;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"new_table";s:5:"value";s:9:"new_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"666";s:5:"value";i:666;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"VARCHAR";s:5:"value";s:7:"VARCHAR";s:7:"keyword";s:7:"VARCHAR";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"50";s:5:"value";i:50;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:53;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"new_table";s:6:"column";N;s:4:"expr";s:9:"new_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:6:"fields";a:0:{}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:27:"A symbol name was expected!";i:1;r:58;i:2;i:0;}i:1;a:3:{i:0;s:44:"At least one column definition was expected.";i:1;r:58;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:86;i:2;i:0;}i:3;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_table (666 VARCHAR(50) DEFAULT NULL);\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_table (666 VARCHAR(50) DEFAULT NULL);\n", + "len": 55, + "last": 55, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_table", + "value": "new_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "666", + "value": 666, + "keyword": null, + "type": 6, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VARCHAR", + "value": "VARCHAR", + "keyword": "VARCHAR", + "type": 1, + "flags": 11, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "50", + "value": 50, + "keyword": null, + "type": 6, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_table", + "column": null, + "expr": "new_table", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "fields": [], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A symbol name was expected!", + { + "@type": "@9" + }, + 0 + ], + [ + "At least one column definition was expected.", + { + "@type": "@9" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@13" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableLike.out b/tests/data/parser/parseCreateTableLike.out index 0606ce777..6291adf33 100644 --- a/tests/data/parser/parseCreateTableLike.out +++ b/tests/data/parser/parseCreateTableLike.out @@ -1 +1,699 @@ -a:4:{s:5:"query";s:43:"CREATE TABLE `table_copy` LIKE `old_table`;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"CREATE TABLE `table_copy` LIKE `old_table`;";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`table_copy`";s:5:"value";s:10:"table_copy";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LIKE";s:5:"value";s:4:"LIKE";s:7:"keyword";s:4:"LIKE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`old_table`";s:5:"value";s:9:"old_table";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:42;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"table_copy";s:6:"column";N;s:4:"expr";s:12:"`table_copy`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";N;s:4:"like";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"old_table";s:6:"column";N;s:4:"expr";s:11:"`old_table`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `table_copy` LIKE `old_table`;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `table_copy` LIKE `old_table`;", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`table_copy`", + "value": "table_copy", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIKE", + "value": "LIKE", + "keyword": "LIKE", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`old_table`", + "value": "old_table", + "keyword": null, + "type": 8, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table_copy", + "column": null, + "expr": "`table_copy`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": null, + "like": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "old_table", + "column": null, + "expr": "`old_table`", + "alias": null, + "function": null, + "subquery": null + }, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableSelect.out b/tests/data/parser/parseCreateTableSelect.out index 595ac224b..bd6bad889 100644 --- a/tests/data/parser/parseCreateTableSelect.out +++ b/tests/data/parser/parseCreateTableSelect.out @@ -1,4 +1,930 @@ -a:4:{s:5:"query";s:44:"CREATE TABLE new_tbl SELECT * FROM orig_tbl -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:44:"CREATE TABLE new_tbl SELECT * FROM orig_tbl -";s:3:"len";i:44;s:4:"last";i:44;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"new_tbl";s:5:"value";s:7:"new_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"orig_tbl";s:5:"value";s:8:"orig_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"new_tbl";s:6:"column";N;s:4:"expr";s:7:"new_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"orig_tbl";s:6:"column";N;s:4:"expr";s:8:"orig_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:6;s:4:"last";i:13;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE new_tbl SELECT * FROM orig_tbl\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE new_tbl SELECT * FROM orig_tbl\n", + "len": 44, + "last": 44, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "new_tbl", + "value": "new_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "orig_tbl", + "value": "orig_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "new_tbl", + "column": null, + "expr": "new_tbl", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "orig_tbl", + "column": null, + "expr": "orig_tbl", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 6, + "last": 13 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableSpatial.out b/tests/data/parser/parseCreateTableSpatial.out index 5925501c3..a7b8fd8ec 100644 --- a/tests/data/parser/parseCreateTableSpatial.out +++ b/tests/data/parser/parseCreateTableSpatial.out @@ -1 +1,909 @@ -a:4:{s:5:"query";s:64:"CREATE TABLE `xss`.`gis` ( `x` POINT NOT NULL ) ENGINE = InnoDB;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:64:"CREATE TABLE `xss`.`gis` ( `x` POINT NOT NULL ) ENGINE = InnoDB;";s:3:"len";i:64;s:4:"last";i:64;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:25:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`xss`";s:5:"value";s:3:"xss";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`gis`";s:5:"value";s:3:"gis";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`x`";s:5:"value";s:1:"x";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"POINT";s:5:"value";s:5:"POINT";s:7:"keyword";s:5:"POINT";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:37;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:48;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:57;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:63;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:25;s:3:"idx";i:25;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:3:"xss";s:5:"table";s:3:"gis";s:6:"column";N;s:4:"expr";s:11:"`xss`.`gis`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}}}s:6:"fields";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:1:"x";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:5:"POINT";s:10:"parameters";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:23;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `xss`.`gis` ( `x` POINT NOT NULL ) ENGINE = InnoDB;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `xss`.`gis` ( `x` POINT NOT NULL ) ENGINE = InnoDB;", + "len": 64, + "last": 64, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`xss`", + "value": "xss", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`gis`", + "value": "gis", + "keyword": null, + "type": 8, + "flags": 2, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`x`", + "value": "x", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "POINT", + "value": "POINT", + "keyword": "POINT", + "type": 1, + "flags": 41, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 25, + "idx": 25 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "xss", + "table": "gis", + "column": null, + "expr": "`xss`.`gis`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "x", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "POINT", + "parameters": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 23 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTableTimestampWithPrecision.out b/tests/data/parser/parseCreateTableTimestampWithPrecision.out index 076289316..4db688864 100644 --- a/tests/data/parser/parseCreateTableTimestampWithPrecision.out +++ b/tests/data/parser/parseCreateTableTimestampWithPrecision.out @@ -1,13 +1,1445 @@ -a:4:{s:5:"query";s:203:"CREATE TABLE `aa` ( - `id` int(11) NOT NULL, - `rTime` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000' ON UPDATE CURRENT_TIMESTAMP(3), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:203:"CREATE TABLE `aa` ( - `id` int(11) NOT NULL, - `rTime` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000' ON UPDATE CURRENT_TIMESTAMP(3), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1;";s:3:"len";i:203;s:4:"last";i:203;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:56:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`aa`";s:5:"value";s:2:"aa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"int";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"11";s:5:"value";i:11;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:35;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`rTime`";s:5:"value";s:5:"rTime";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"timestamp";s:5:"value";s:9:"timestamp";s:7:"keyword";s:9:"TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:41;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:65;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:66;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"NOT NULL";s:5:"value";s:8:"NOT NULL";s:7:"keyword";s:8:"NOT NULL";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:68;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:77;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:25:"'0000-00-00 00:00:00.000'";s:5:"value";s:23:"0000-00-00 00:00:00.000";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:85;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ON UPDATE";s:5:"value";s:9:"ON UPDATE";s:7:"keyword";s:9:"ON UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:111;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"CURRENT_TIMESTAMP";s:5:"value";s:17:"CURRENT_TIMESTAMP";s:7:"keyword";s:17:"CURRENT_TIMESTAMP";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:121;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:138;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:139;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:140;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:141;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"PRIMARY KEY";s:5:"value";s:11:"PRIMARY KEY";s:7:"keyword";s:11:"PRIMARY KEY";s:4:"type";i:1;s:5:"flags";i:23;s:8:"position";i:145;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:156;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:157;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:158;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:162;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:163;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:164;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:165;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"ENGINE";s:5:"value";s:6:"ENGINE";s:7:"keyword";s:6:"ENGINE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:166;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:172;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:173;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:179;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"DEFAULT CHARSET";s:5:"value";s:15:"DEFAULT CHARSET";s:7:"keyword";s:15:"DEFAULT CHARSET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:180;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:195;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"latin1";s:5:"value";s:6:"latin1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:196;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:202;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:56;s:3:"idx";i:56;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"aa";s:6:"column";N;s:4:"expr";s:4:"`aa`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;a:4:{s:4:"name";s:6:"ENGINE";s:6:"equals";b:1;s:4:"expr";s:6:"InnoDB";s:5:"value";s:6:"InnoDB";}i:4;a:4:{s:4:"name";s:15:"DEFAULT CHARSET";s:6:"equals";b:1;s:4:"expr";s:6:"latin1";s:5:"value";s:6:"latin1";}}}s:6:"fields";a:3:{i:0;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:2:"id";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:3:"INT";s:10:"parameters";a:1:{i:0;s:2:"11";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"NOT NULL";}}}i:1;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";s:5:"rTime";s:12:"isConstraint";N;s:4:"type";O:40:"PhpMyAdmin\SqlParser\Components\DataType":3:{s:4:"name";s:9:"TIMESTAMP";s:10:"parameters";a:1:{i:0;s:1:"3";}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:3:"key";N;s:10:"references";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;s:8:"NOT NULL";i:2;a:4:{s:4:"name";s:7:"DEFAULT";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:23:"0000-00-00 00:00:00.000";s:4:"expr";s:25:"'0000-00-00 00:00:00.000'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:25:"'0000-00-00 00:00:00.000'";}i:7;a:4:{s:4:"name";s:9:"ON UPDATE";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:20:"CURRENT_TIMESTAMP(3)";s:5:"alias";N;s:8:"function";s:17:"CURRENT_TIMESTAMP";s:8:"subquery";N;}s:5:"value";s:20:"CURRENT_TIMESTAMP(3)";}}}}i:2;O:48:"PhpMyAdmin\SqlParser\Components\CreateDefinition":6:{s:4:"name";N;s:12:"isConstraint";N;s:4:"type";N;s:3:"key";O:35:"PhpMyAdmin\SqlParser\Components\Key":4:{s:4:"name";N;s:7:"columns";a:1:{i:0;a:1:{s:4:"name";s:2:"id";}}s:4:"type";s:11:"PRIMARY KEY";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}}s:10:"references";N;s:7:"options";N;}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:5:"TABLE";}}s:5:"first";i:0;s:4:"last";i:54;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TABLE `aa` (\n `id` int(11) NOT NULL,\n `rTime` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000' ON UPDATE CURRENT_TIMESTAMP(3),\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TABLE `aa` (\n `id` int(11) NOT NULL,\n `rTime` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000' ON UPDATE CURRENT_TIMESTAMP(3),\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;", + "len": 203, + "last": 203, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`aa`", + "value": "aa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "int", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "11", + "value": 11, + "keyword": null, + "type": 6, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`rTime`", + "value": "rTime", + "keyword": null, + "type": 8, + "flags": 2, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "timestamp", + "value": "timestamp", + "keyword": "TIMESTAMP", + "type": 1, + "flags": 41, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT NULL", + "value": "NOT NULL", + "keyword": "NOT NULL", + "type": 1, + "flags": 7, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'0000-00-00 00:00:00.000'", + "value": "0000-00-00 00:00:00.000", + "keyword": null, + "type": 7, + "flags": 1, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON UPDATE", + "value": "ON UPDATE", + "keyword": "ON UPDATE", + "type": 1, + "flags": 7, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CURRENT_TIMESTAMP", + "value": "CURRENT_TIMESTAMP", + "keyword": "CURRENT_TIMESTAMP", + "type": 1, + "flags": 35, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PRIMARY KEY", + "value": "PRIMARY KEY", + "keyword": "PRIMARY KEY", + "type": 1, + "flags": 23, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENGINE", + "value": "ENGINE", + "keyword": "ENGINE", + "type": 1, + "flags": 1, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "InnoDB", + "value": "InnoDB", + "keyword": null, + "type": 0, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT CHARSET", + "value": "DEFAULT CHARSET", + "keyword": "DEFAULT CHARSET", + "type": 1, + "flags": 7, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "latin1", + "value": "latin1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 56, + "idx": 56 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "aa", + "column": null, + "expr": "`aa`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "ENGINE", + "equals": true, + "expr": "InnoDB", + "value": "InnoDB" + }, + "4": { + "name": "DEFAULT CHARSET", + "equals": true, + "expr": "latin1", + "value": "latin1" + } + } + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "id", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "INT", + "parameters": [ + "11" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL" + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": "rTime", + "isConstraint": null, + "type": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\DataType", + "DATA_TYPE_OPTIONS": { + "BINARY": 1, + "CHARACTER SET": [ + 2, + "var" + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "UNSIGNED": 4, + "ZEROFILL": 5 + }, + "name": "TIMESTAMP", + "parameters": [ + "3" + ], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "key": null, + "references": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "NOT NULL", + "2": { + "name": "DEFAULT", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "0000-00-00 00:00:00.000", + "expr": "'0000-00-00 00:00:00.000'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'0000-00-00 00:00:00.000'" + }, + "7": { + "name": "ON UPDATE", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "CURRENT_TIMESTAMP(3)", + "alias": null, + "function": "CURRENT_TIMESTAMP", + "subquery": null + }, + "value": "CURRENT_TIMESTAMP(3)" + } + } + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CreateDefinition", + "FIELD_OPTIONS": { + "_UNSORTED": true, + "NOT NULL": 1, + "NULL": 1, + "DEFAULT": [ + 2, + "expr", + { + "breakOnAlias": true + } + ], + "CHARSET": [ + 2, + "var" + ], + "COLLATE": [ + 3, + "var" + ], + "AUTO_INCREMENT": 3, + "PRIMARY": 4, + "PRIMARY KEY": 4, + "UNIQUE": 4, + "UNIQUE KEY": 4, + "COMMENT": [ + 5, + "var" + ], + "COLUMN_FORMAT": [ + 6, + "var" + ], + "ON UPDATE": [ + 7, + "expr" + ], + "GENERATED ALWAYS": 8, + "AS": [ + 9, + "expr", + { + "parenthesesDelimited": true + } + ], + "VIRTUAL": 10, + "PERSISTENT": 11, + "STORED": 11, + "CHECK": [ + 12, + "expr", + { + "parenthesesDelimited": true + } + ], + "INVISIBLE": 13 + }, + "name": null, + "isConstraint": null, + "type": null, + "key": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Key", + "KEY_OPTIONS": { + "KEY_BLOCK_SIZE": [ + 1, + "var" + ], + "USING": [ + 2, + "var" + ], + "WITH PARSER": [ + 3, + "var" + ], + "COMMENT": [ + 4, + "var=" + ] + }, + "name": null, + "columns": [ + { + "name": "id" + } + ], + "type": "PRIMARY KEY", + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + } + }, + "references": null, + "options": null + } + ], + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TABLE" + } + }, + "first": 0, + "last": 54 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateTrigger.out b/tests/data/parser/parseCreateTrigger.out index 6390ce809..0bf12b438 100644 --- a/tests/data/parser/parseCreateTrigger.out +++ b/tests/data/parser/parseCreateTrigger.out @@ -1,4 +1,967 @@ -a:4:{s:5:"query";s:99:"CREATE TRIGGER ins_sum BEFORE INSERT ON account -FOR EACH ROW BEGIN SET @sum = @sum + NEW.amount END";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:99:"CREATE TRIGGER ins_sum BEFORE INSERT ON account -FOR EACH ROW BEGIN SET @sum = @sum + NEW.amount END";s:3:"len";i:99;s:4:"last";i:99;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"TRIGGER";s:5:"value";s:7:"TRIGGER";s:7:"keyword";s:7:"TRIGGER";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"ins_sum";s:5:"value";s:7:"ins_sum";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BEFORE";s:5:"value";s:6:"BEFORE";s:7:"keyword";s:6:"BEFORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:30;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"account";s:5:"value";s:7:"account";s:7:"keyword";s:7:"ACCOUNT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"FOR EACH ROW";s:5:"value";s:12:"FOR EACH ROW";s:7:"keyword";s:12:"FOR EACH ROW";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:48;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"BEGIN";s:5:"value";s:5:"BEGIN";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:61;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:67;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@sum";s:5:"value";s:3:"sum";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:76;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@sum";s:5:"value";s:3:"sum";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:78;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:83;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"NEW";s:5:"value";s:3:"NEW";s:7:"keyword";s:3:"NEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:85;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"amount";s:5:"value";s:6:"amount";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:89;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:96;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:35;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"ins_sum";s:6:"column";N;s:4:"expr";s:7:"ins_sum";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:6:"BEFORE";i:2;s:6:"INSERT";}}s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"account";s:6:"column";N;s:4:"expr";s:7:"account";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:6:"return";N;s:10:"parameters";N;s:4:"body";a:18:{i:0;r:121;i:1;r:128;i:2;r:135;i:3;r:142;i:4;r:149;i:5;r:156;i:6;r:163;i:7;r:170;i:8;r:177;i:9;r:184;i:10;r:191;i:11;r:198;i:12;r:205;i:13;r:212;i:14;r:219;i:15;r:226;i:16;r:233;i:17;r:240;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:7:"TRIGGER";}}s:5:"first";i:0;s:4:"last";i:34;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE TRIGGER ins_sum BEFORE INSERT ON account\nFOR EACH ROW BEGIN SET @sum = @sum + NEW.amount END", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE TRIGGER ins_sum BEFORE INSERT ON account\nFOR EACH ROW BEGIN SET @sum = @sum + NEW.amount END", + "len": 99, + "last": 99, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TRIGGER", + "value": "TRIGGER", + "keyword": "TRIGGER", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ins_sum", + "value": "ins_sum", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEFORE", + "value": "BEFORE", + "keyword": "BEFORE", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "account", + "value": "account", + "keyword": "ACCOUNT", + "type": 1, + "flags": 1, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR EACH ROW", + "value": "FOR EACH ROW", + "keyword": "FOR EACH ROW", + "type": 1, + "flags": 7, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEGIN", + "value": "BEGIN", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@sum", + "value": "sum", + "keyword": null, + "type": 8, + "flags": 1, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@sum", + "value": "sum", + "keyword": null, + "type": 8, + "flags": 1, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NEW", + "value": "NEW", + "keyword": "NEW", + "type": 1, + "flags": 1, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "amount", + "value": "amount", + "keyword": null, + "type": 0, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 35 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "ins_sum", + "column": null, + "expr": "ins_sum", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "BEFORE", + "2": "INSERT" + } + }, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "account", + "column": null, + "expr": "account", + "alias": null, + "function": null, + "subquery": null + }, + "return": null, + "parameters": null, + "body": [ + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + }, + { + "@type": "@35" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "TRIGGER" + } + }, + "first": 0, + "last": 34 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateUser.out b/tests/data/parser/parseCreateUser.out index d1fb54135..b28143ebf 100644 --- a/tests/data/parser/parseCreateUser.out +++ b/tests/data/parser/parseCreateUser.out @@ -1 +1,632 @@ -a:4:{s:5:"query";s:16:"CREATE USER test";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:16:"CREATE USER test";s:3:"len";i:16;s:4:"last";i:16;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"USER";s:5:"value";s:4:"USER";s:7:"keyword";s:4:"USER";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:4:"USER";}}s:5:"first";i:0;s:4:"last";i:5;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE USER test", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE USER test", + "len": 16, + "last": 16, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USER", + "value": "USER", + "keyword": "USER", + "type": 1, + "flags": 33, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "USER" + } + }, + "first": 0, + "last": 5 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateView.out b/tests/data/parser/parseCreateView.out index 92209a73e..d1bd9fb2a 100644 --- a/tests/data/parser/parseCreateView.out +++ b/tests/data/parser/parseCreateView.out @@ -1 +1,3560 @@ -a:4:{s:5:"query";s:960:"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `sakila`.`actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name`";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:960:"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `sakila`.`actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name`";s:3:"len";i:960;s:4:"last";i:960;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:286:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ALGORITHM";s:5:"value";s:9:"ALGORITHM";s:7:"keyword";s:9:"ALGORITHM";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";s:7:"keyword";s:9:"UNDEFINED";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";s:7:"keyword";s:7:"DEFINER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`root`@`localhost`";s:5:"value";s:14:"root@localhost";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:4;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SQL SECURITY";s:5:"value";s:12:"SQL SECURITY";s:7:"keyword";s:12:"SQL SECURITY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:54;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"INVOKER";s:5:"value";s:7:"INVOKER";s:7:"keyword";s:7:"INVOKER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:67;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:75;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:80;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`actor_info`";s:5:"value";s:10:"actor_info";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:89;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:105;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:112;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:115;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:116;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:127;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:130;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:140;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:141;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:144;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`first_name`";s:5:"value";s:10:"first_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:145;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:158;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:160;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`first_name`";s:5:"value";s:10:"first_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:161;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:173;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:174;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:177;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`last_name`";s:5:"value";s:9:"last_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:178;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:189;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:190;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:192;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`last_name`";s:5:"value";s:9:"last_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:193;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:204;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"group_concat";s:5:"value";s:12:"group_concat";s:7:"keyword";s:12:"GROUP_CONCAT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:205;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:217;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"distinct";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:218;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:226;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"concat";s:5:"value";s:6:"concat";s:7:"keyword";s:6:"CONCAT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:227;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:233;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`c`";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:234;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:237;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`name`";s:5:"value";s:4:"name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:238;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:244;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"': '";s:5:"value";s:2:": ";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:245;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:249;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:250;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:251;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:257;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"group_concat";s:5:"value";s:12:"group_concat";s:7:"keyword";s:12:"GROUP_CONCAT";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:258;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:270;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`f`";s:5:"value";s:1:"f";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:271;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:274;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`title`";s:5:"value";s:5:"title";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:275;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:282;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"order by";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:283;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:291;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`f`";s:5:"value";s:1:"f";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:292;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:295;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`title`";s:5:"value";s:5:"title";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:296;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:303;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:304;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:307;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"separator";s:5:"value";s:9:"SEPARATOR";s:7:"keyword";s:9:"SEPARATOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:308;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:317;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"', '";s:5:"value";s:2:", ";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:318;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:322;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:323;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:324;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:328;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:329;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:330;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:331;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:339;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`film`";s:5:"value";s:4:"film";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:340;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:346;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`f`";s:5:"value";s:1:"f";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:347;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:350;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"join";s:5:"value";s:4:"JOIN";s:7:"keyword";s:4:"JOIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:351;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:355;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:356;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:364;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`film_category`";s:5:"value";s:13:"film_category";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:365;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:380;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:381;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:385;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:386;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:388;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:389;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`f`";s:5:"value";s:1:"f";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:390;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:393;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:394;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:403;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:404;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:405;}i:109;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:406;}i:110;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:410;}i:111;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:411;}i:112;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:420;}i:113;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:421;}i:114;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:422;}i:115;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:423;}i:116;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"join";s:5:"value";s:4:"JOIN";s:7:"keyword";s:4:"JOIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:424;}i:117;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:428;}i:118;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:429;}i:119;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:437;}i:120;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`film_actor`";s:5:"value";s:10:"film_actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:438;}i:121;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:450;}i:122;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:451;}i:123;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:455;}i:124;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:456;}i:125;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:458;}i:126;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:459;}i:127;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`f`";s:5:"value";s:1:"f";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:460;}i:128;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:463;}i:129;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:464;}i:130;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:473;}i:131;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:474;}i:132;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:475;}i:133;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:476;}i:134;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:480;}i:135;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:481;}i:136;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:490;}i:137;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:491;}i:138;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:492;}i:139;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:493;}i:140;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"where";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:494;}i:141;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:499;}i:142;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:500;}i:143;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:501;}i:144;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:502;}i:145;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:506;}i:146;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`category_id`";s:5:"value";s:11:"category_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:507;}i:147;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:520;}i:148;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:521;}i:149;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:522;}i:150;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`c`";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:523;}i:151;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:526;}i:152;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`category_id`";s:5:"value";s:11:"category_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:527;}i:153;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:540;}i:154;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:541;}i:155;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"and";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:542;}i:156;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:545;}i:157;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:546;}i:158;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:547;}i:159;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:551;}i:160;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:552;}i:161;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:562;}i:162;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:563;}i:163;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:564;}i:164;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:565;}i:165;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:568;}i:166;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:569;}i:167;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:579;}i:168;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:580;}i:169;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:581;}i:170;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:582;}i:171;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:583;}i:172;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"order by";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:584;}i:173;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:592;}i:174;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`c`";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:593;}i:175;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:596;}i:176;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`name`";s:5:"value";s:4:"name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:597;}i:177;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:603;}i:178;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:604;}i:179;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:607;}i:180;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"separator";s:5:"value";s:9:"SEPARATOR";s:7:"keyword";s:9:"SEPARATOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:608;}i:181;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:617;}i:182;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'; '";s:5:"value";s:2:"; ";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:618;}i:183;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:622;}i:184;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:623;}i:185;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:624;}i:186;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:626;}i:187;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`film_info`";s:5:"value";s:9:"film_info";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:627;}i:188;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:638;}i:189;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:639;}i:190;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:643;}i:191;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:644;}i:192;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:645;}i:193;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:646;}i:194;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:647;}i:195;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:655;}i:196;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`actor`";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:656;}i:197;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:663;}i:198;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:664;}i:199;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:667;}i:200;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"left join";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:668;}i:201;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:677;}i:202;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:678;}i:203;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:686;}i:204;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`film_actor`";s:5:"value";s:10:"film_actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:687;}i:205;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:699;}i:206;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:700;}i:207;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:704;}i:208;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:705;}i:209;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:707;}i:210;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:708;}i:211;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:709;}i:212;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:712;}i:213;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:713;}i:214;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:723;}i:215;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:724;}i:216;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:725;}i:217;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:726;}i:218;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:730;}i:219;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:731;}i:220;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:741;}i:221;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:742;}i:222;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:743;}i:223;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:744;}i:224;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"left join";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:745;}i:225;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:754;}i:226;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:755;}i:227;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:763;}i:228;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`film_category`";s:5:"value";s:13:"film_category";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:764;}i:229;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:779;}i:230;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:780;}i:231;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:784;}i:232;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:785;}i:233;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:787;}i:234;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:788;}i:235;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fa`";s:5:"value";s:2:"fa";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:789;}i:236;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:793;}i:237;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:794;}i:238;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:803;}i:239;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:804;}i:240;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:805;}i:241;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:806;}i:242;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:810;}i:243;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"`film_id`";s:5:"value";s:7:"film_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:811;}i:244;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:820;}i:245;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:821;}i:246;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:822;}i:247;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:823;}i:248;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"left join";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:824;}i:249;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:833;}i:250;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`sakila`";s:5:"value";s:6:"sakila";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:834;}i:251;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:842;}i:252;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`category`";s:5:"value";s:8:"category";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:843;}i:253;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:853;}i:254;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`c`";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:854;}i:255;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:857;}i:256;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:858;}i:257;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:860;}i:258;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:861;}i:259;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`fc`";s:5:"value";s:2:"fc";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:862;}i:260;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:866;}i:261;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`category_id`";s:5:"value";s:11:"category_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:867;}i:262;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:880;}i:263;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:881;}i:264;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:882;}i:265;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`c`";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:883;}i:266;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:886;}i:267;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`category_id`";s:5:"value";s:11:"category_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:887;}i:268;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:900;}i:269;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:901;}i:270;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:902;}i:271;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:903;}i:272;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"group by";s:5:"value";s:8:"GROUP BY";s:7:"keyword";s:8:"GROUP BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:904;}i:273;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:912;}i:274;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:913;}i:275;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:916;}i:276;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`actor_id`";s:5:"value";s:8:"actor_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:917;}i:277;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:927;}i:278;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:928;}i:279;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:931;}i:280;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`first_name`";s:5:"value";s:10:"first_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:932;}i:281;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:944;}i:282;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:945;}i:283;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:948;}i:284;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`last_name`";s:5:"value";s:9:"last_name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:949;}i:285;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:286;s:3:"idx";i:286;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:6:"sakila";s:5:"table";s:10:"actor_info";s:6:"column";N;s:4:"expr";s:21:"`sakila`.`actor_info`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:4:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:8:"actor_id";s:4:"expr";s:14:"`a`.`actor_id`";s:5:"alias";s:8:"actor_id";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:10:"first_name";s:4:"expr";s:16:"`a`.`first_name`";s:5:"alias";s:10:"first_name";s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:9:"last_name";s:4:"expr";s:15:"`a`.`last_name`";s:5:"alias";s:9:"last_name";s:8:"function";N;s:8:"subquery";N;}i:3;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:418:"group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ')";s:5:"alias";s:9:"film_info";s:8:"function";s:12:"group_concat";s:8:"subquery";s:6:"SELECT";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:259:"(((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`)))";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";a:3:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\GroupKeyword":1:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:8:"actor_id";s:4:"expr";s:14:"`a`.`actor_id`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}i:1;O:44:"PhpMyAdmin\SqlParser\Components\GroupKeyword":1:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:10:"first_name";s:4:"expr";s:16:"`a`.`first_name`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}i:2;O:44:"PhpMyAdmin\SqlParser\Components\GroupKeyword":1:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";s:9:"last_name";s:4:"expr";s:15:"`a`.`last_name`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:22;s:4:"last";i:284;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:4:{i:3;a:4:{s:4:"name";s:9:"ALGORITHM";s:6:"equals";b:1;s:4:"expr";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";}i:4;a:4:{s:4:"name";s:7:"DEFINER";s:6:"equals";b:1;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:14:"root@localhost";s:4:"expr";s:18:"`root`@`localhost`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:18:"`root`@`localhost`";}i:5;a:4:{s:4:"name";s:12:"SQL SECURITY";s:6:"equals";b:0;s:4:"expr";s:7:"INVOKER";s:5:"value";s:7:"INVOKER";}i:6;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:284;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `sakila`.`actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name`", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `sakila`.`actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name`", + "len": 960, + "last": 960, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALGORITHM", + "value": "ALGORITHM", + "keyword": "ALGORITHM", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNDEFINED", + "value": "UNDEFINED", + "keyword": "UNDEFINED", + "type": 1, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFINER", + "value": "DEFINER", + "keyword": "DEFINER", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`root`@`localhost`", + "value": "root@localhost", + "keyword": null, + "type": 8, + "flags": 4, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SQL SECURITY", + "value": "SQL SECURITY", + "keyword": "SQL SECURITY", + "type": 1, + "flags": 7, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INVOKER", + "value": "INVOKER", + "keyword": "INVOKER", + "type": 1, + "flags": 1, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_info`", + "value": "actor_info", + "keyword": null, + "type": 8, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`first_name`", + "value": "first_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`first_name`", + "value": "first_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_name`", + "value": "last_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 192 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_name`", + "value": "last_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 193 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 204 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "group_concat", + "value": "group_concat", + "keyword": "GROUP_CONCAT", + "type": 1, + "flags": 33, + "position": 205 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 217 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "distinct", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 226 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "concat", + "value": "concat", + "keyword": "CONCAT", + "type": 1, + "flags": 33, + "position": 227 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 233 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`c`", + "value": "c", + "keyword": null, + "type": 8, + "flags": 2, + "position": 234 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 237 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`name`", + "value": "name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 238 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "': '", + "value": ": ", + "keyword": null, + "type": 7, + "flags": 1, + "position": 245 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 249 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 250 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 251 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 257 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "group_concat", + "value": "group_concat", + "keyword": "GROUP_CONCAT", + "type": 1, + "flags": 33, + "position": 258 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 270 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`f`", + "value": "f", + "keyword": null, + "type": 8, + "flags": 2, + "position": 271 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 274 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`title`", + "value": "title", + "keyword": null, + "type": 8, + "flags": 2, + "position": 275 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 282 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "order by", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 283 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 291 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`f`", + "value": "f", + "keyword": null, + "type": 8, + "flags": 2, + "position": 292 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 295 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`title`", + "value": "title", + "keyword": null, + "type": 8, + "flags": 2, + "position": 296 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 303 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 304 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 307 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "separator", + "value": "SEPARATOR", + "keyword": "SEPARATOR", + "type": 1, + "flags": 3, + "position": 308 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 317 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "', '", + "value": ", ", + "keyword": null, + "type": 7, + "flags": 1, + "position": 318 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 322 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 323 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 324 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 328 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 329 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 330 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 331 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 339 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film`", + "value": "film", + "keyword": null, + "type": 8, + "flags": 2, + "position": 340 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 346 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`f`", + "value": "f", + "keyword": null, + "type": 8, + "flags": 2, + "position": 347 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 350 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "join", + "value": "JOIN", + "keyword": "JOIN", + "type": 1, + "flags": 3, + "position": 351 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 355 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 356 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 364 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_category`", + "value": "film_category", + "keyword": null, + "type": 8, + "flags": 2, + "position": 365 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 380 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 381 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 385 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 386 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 388 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 389 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`f`", + "value": "f", + "keyword": null, + "type": 8, + "flags": 2, + "position": 390 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 393 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 394 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 403 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 404 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 405 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 406 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 410 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 411 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 420 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 421 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 422 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 423 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "join", + "value": "JOIN", + "keyword": "JOIN", + "type": 1, + "flags": 3, + "position": 424 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 428 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 429 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 437 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_actor`", + "value": "film_actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 438 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 450 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 451 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 455 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 456 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 458 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 459 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`f`", + "value": "f", + "keyword": null, + "type": 8, + "flags": 2, + "position": 460 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 463 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 464 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 473 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 474 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 475 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 476 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 480 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 481 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 490 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 491 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 492 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 493 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "where", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 494 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 499 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 500 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 501 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 502 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 506 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`category_id`", + "value": "category_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 507 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 520 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 521 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 522 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`c`", + "value": "c", + "keyword": null, + "type": 8, + "flags": 2, + "position": 523 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 526 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`category_id`", + "value": "category_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 527 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 540 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 541 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "and", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 542 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 545 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 546 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 547 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 551 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 552 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 562 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 563 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 564 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 565 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 568 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 569 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 579 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 580 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 581 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 582 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 583 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "order by", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 584 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 592 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`c`", + "value": "c", + "keyword": null, + "type": 8, + "flags": 2, + "position": 593 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 596 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`name`", + "value": "name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 597 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 603 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 604 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 607 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "separator", + "value": "SEPARATOR", + "keyword": "SEPARATOR", + "type": 1, + "flags": 3, + "position": 608 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 617 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'; '", + "value": "; ", + "keyword": null, + "type": 7, + "flags": 1, + "position": 618 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 622 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 623 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 624 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 626 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_info`", + "value": "film_info", + "keyword": null, + "type": 8, + "flags": 2, + "position": 627 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 638 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 639 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 643 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 644 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 645 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 646 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 647 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 655 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor`", + "value": "actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 656 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 663 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 664 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 667 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left join", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 668 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 677 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 678 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 686 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_actor`", + "value": "film_actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 687 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 699 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 700 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 704 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 705 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 707 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 708 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 709 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 712 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 713 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 723 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 724 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 725 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 726 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 730 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 731 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 741 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 742 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 743 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 744 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left join", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 745 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 754 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 755 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 763 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_category`", + "value": "film_category", + "keyword": null, + "type": 8, + "flags": 2, + "position": 764 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 779 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 780 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 784 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 785 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 787 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 788 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fa`", + "value": "fa", + "keyword": null, + "type": 8, + "flags": 2, + "position": 789 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 793 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 794 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 803 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 804 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 805 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 806 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 810 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`film_id`", + "value": "film_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 811 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 820 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 821 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 822 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 823 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left join", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 824 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 833 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`sakila`", + "value": "sakila", + "keyword": null, + "type": 8, + "flags": 2, + "position": 834 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 842 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`category`", + "value": "category", + "keyword": null, + "type": 8, + "flags": 2, + "position": 843 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 853 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`c`", + "value": "c", + "keyword": null, + "type": 8, + "flags": 2, + "position": 854 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 857 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 858 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 860 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 861 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`fc`", + "value": "fc", + "keyword": null, + "type": 8, + "flags": 2, + "position": 862 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 866 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`category_id`", + "value": "category_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 867 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 880 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 881 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 882 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`c`", + "value": "c", + "keyword": null, + "type": 8, + "flags": 2, + "position": 883 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 886 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`category_id`", + "value": "category_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 887 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 900 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 901 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 902 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 903 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "group by", + "value": "GROUP BY", + "keyword": "GROUP BY", + "type": 1, + "flags": 7, + "position": 904 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 912 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 913 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 916 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor_id`", + "value": "actor_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 917 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 927 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 928 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 931 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`first_name`", + "value": "first_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 932 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 944 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 945 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 948 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`last_name`", + "value": "last_name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 949 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 286, + "idx": 286 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "sakila", + "table": "actor_info", + "column": null, + "expr": "`sakila`.`actor_info`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "actor_id", + "expr": "`a`.`actor_id`", + "alias": "actor_id", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "first_name", + "expr": "`a`.`first_name`", + "alias": "first_name", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "last_name", + "expr": "`a`.`last_name`", + "alias": "last_name", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`sakila`.`film` `f` join `sakila`.`film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `sakila`.`film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ')", + "alias": "film_info", + "function": "group_concat", + "subquery": "SELECT" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(((`sakila`.`actor` `a` left join `sakila`.`film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `sakila`.`film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `sakila`.`category` `c` on((`fc`.`category_id` = `c`.`category_id`)))", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "type": null, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "actor_id", + "expr": "`a`.`actor_id`", + "alias": null, + "function": null, + "subquery": null + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "type": null, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "first_name", + "expr": "`a`.`first_name`", + "alias": null, + "function": null, + "subquery": null + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "type": null, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": "last_name", + "expr": "`a`.`last_name`", + "alias": null, + "function": null, + "subquery": null + } + } + ], + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 22, + "last": 284 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "ALGORITHM", + "equals": true, + "expr": "UNDEFINED", + "value": "UNDEFINED" + }, + "4": { + "name": "DEFINER", + "equals": true, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "root@localhost", + "expr": "`root`@`localhost`", + "alias": null, + "function": null, + "subquery": null + }, + "value": "`root`@`localhost`" + }, + "5": { + "name": "SQL SECURITY", + "equals": false, + "expr": "INVOKER", + "value": "INVOKER" + }, + "6": "VIEW" + } + }, + "first": 0, + "last": 284 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateView2.out b/tests/data/parser/parseCreateView2.out index 6557d8984..aacf422b2 100644 --- a/tests/data/parser/parseCreateView2.out +++ b/tests/data/parser/parseCreateView2.out @@ -1,4 +1,961 @@ -a:4:{s:5:"query";s:89:"CREATE VIEW myView (vid, vfirstname) AS -SELECT id, first_name FROM employee WHERE id = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:89:"CREATE VIEW myView (vid, vfirstname) AS -SELECT id, first_name FROM employee WHERE id = 1;";s:3:"len";i:89;s:4:"last";i:89;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:35:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"myView";s:5:"value";s:6:"myView";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"vid";s:5:"value";s:3:"vid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"vfirstname";s:5:"value";s:10:"vfirstname";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"first_name";s:5:"value";s:10:"first_name";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:62;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"employee";s:5:"value";s:8:"employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:67;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:85;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:88;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:35;s:3:"idx";i:35;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"myView";s:6:"column";N;s:4:"expr";s:6:"myView";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:3:"vid";i:1;s:10:"vfirstname";}s:6:"values";a:2:{i:0;s:3:"vid";i:1;s:10:"vfirstname";}}s:6:"select";N;s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:19:{i:0;r:107;i:1;r:114;i:2;r:121;i:3;r:128;i:4;r:135;i:5;r:142;i:6;r:149;i:7;r:156;i:8;r:163;i:9;r:170;i:10;r:177;i:11;r:184;i:12;r:191;i:13;r:198;i:14;r:205;i:15;r:212;i:16;r:219;i:17;r:226;i:18;r:233;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:33;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE VIEW myView (vid, vfirstname) AS\nSELECT id, first_name FROM employee WHERE id = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE VIEW myView (vid, vfirstname) AS\nSELECT id, first_name FROM employee WHERE id = 1;", + "len": 89, + "last": 89, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "myView", + "value": "myView", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "vid", + "value": "vid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "vfirstname", + "value": "vfirstname", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "first_name", + "value": "first_name", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "employee", + "value": "employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 35, + "idx": 35 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "myView", + "column": null, + "expr": "myView", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "vid", + "vfirstname" + ], + "values": [ + "vid", + "vfirstname" + ] + }, + "select": null, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [ + { + "@type": "@16" + }, + { + "@type": "@17" + }, + { + "@type": "@18" + }, + { + "@type": "@19" + }, + { + "@type": "@20" + }, + { + "@type": "@21" + }, + { + "@type": "@22" + }, + { + "@type": "@23" + }, + { + "@type": "@24" + }, + { + "@type": "@25" + }, + { + "@type": "@26" + }, + { + "@type": "@27" + }, + { + "@type": "@28" + }, + { + "@type": "@29" + }, + { + "@type": "@30" + }, + { + "@type": "@31" + }, + { + "@type": "@32" + }, + { + "@type": "@33" + }, + { + "@type": "@34" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "VIEW" + } + }, + "first": 0, + "last": 33 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateViewWithQuotes.out b/tests/data/parser/parseCreateViewWithQuotes.out index 6c6a2c1ea..e341fba4d 100644 --- a/tests/data/parser/parseCreateViewWithQuotes.out +++ b/tests/data/parser/parseCreateViewWithQuotes.out @@ -1,10 +1,1254 @@ -a:4:{s:5:"query";s:211:"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` -SQL SECURITY DEFINER VIEW `test_view` AS -select `email_content`.`content_id` AS `content_id`, -`email_content`.`brand_id` AS `brand_id` from `email_content`;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:211:"CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` -SQL SECURITY DEFINER VIEW `test_view` AS -select `email_content`.`content_id` AS `content_id`, -`email_content`.`brand_id` AS `brand_id` from `email_content`;";s:3:"len";i:211;s:4:"last";i:211;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:44:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ALGORITHM";s:5:"value";s:9:"ALGORITHM";s:7:"keyword";s:9:"ALGORITHM";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";s:7:"keyword";s:9:"UNDEFINED";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";s:7:"keyword";s:7:"DEFINER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`root`@`localhost`";s:5:"value";s:14:"root@localhost";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:4;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SQL SECURITY";s:5:"value";s:12:"SQL SECURITY";s:7:"keyword";s:12:"SQL SECURITY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:54;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";s:7:"keyword";s:7:"DEFINER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:67;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:75;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`test_view`";s:5:"value";s:9:"test_view";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:80;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:103;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:118;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`content_id`";s:5:"value";s:10:"content_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:119;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:132;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`content_id`";s:5:"value";s:10:"content_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:135;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:147;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:149;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:164;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`brand_id`";s:5:"value";s:8:"brand_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:165;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:175;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:176;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:178;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`brand_id`";s:5:"value";s:8:"brand_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:179;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:189;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:190;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:194;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:195;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:210;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:44;s:3:"idx";i:44;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"test_view";s:6:"column";N;s:4:"expr";s:11:"`test_view`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";s:10:"content_id";s:4:"expr";s:28:"`email_content`.`content_id`";s:5:"alias";s:10:"content_id";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";s:8:"brand_id";s:4:"expr";s:26:"`email_content`.`brand_id`";s:5:"alias";s:8:"brand_id";s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";N;s:4:"expr";s:15:"`email_content`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:20;s:4:"last";i:41;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:4:{i:3;a:4:{s:4:"name";s:9:"ALGORITHM";s:6:"equals";b:1;s:4:"expr";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";}i:4;a:4:{s:4:"name";s:7:"DEFINER";s:6:"equals";b:1;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:14:"root@localhost";s:4:"expr";s:18:"`root`@`localhost`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:18:"`root`@`localhost`";}i:5;a:4:{s:4:"name";s:12:"SQL SECURITY";s:6:"equals";b:0;s:4:"expr";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";}i:6;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:41;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`\nSQL SECURITY DEFINER VIEW `test_view` AS\nselect `email_content`.`content_id` AS `content_id`,\n`email_content`.`brand_id` AS `brand_id` from `email_content`;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`\nSQL SECURITY DEFINER VIEW `test_view` AS\nselect `email_content`.`content_id` AS `content_id`,\n`email_content`.`brand_id` AS `brand_id` from `email_content`;", + "len": 211, + "last": 211, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALGORITHM", + "value": "ALGORITHM", + "keyword": "ALGORITHM", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNDEFINED", + "value": "UNDEFINED", + "keyword": "UNDEFINED", + "type": 1, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFINER", + "value": "DEFINER", + "keyword": "DEFINER", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`root`@`localhost`", + "value": "root@localhost", + "keyword": null, + "type": 8, + "flags": 4, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SQL SECURITY", + "value": "SQL SECURITY", + "keyword": "SQL SECURITY", + "type": 1, + "flags": 7, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFINER", + "value": "DEFINER", + "keyword": "DEFINER", + "type": 1, + "flags": 1, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`test_view`", + "value": "test_view", + "keyword": null, + "type": 8, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`content_id`", + "value": "content_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`content_id`", + "value": "content_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`brand_id`", + "value": "brand_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`brand_id`", + "value": "brand_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 189 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 194 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 44, + "idx": 44 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test_view", + "column": null, + "expr": "`test_view`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": "content_id", + "expr": "`email_content`.`content_id`", + "alias": "content_id", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": "brand_id", + "expr": "`email_content`.`brand_id`", + "alias": "brand_id", + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": null, + "expr": "`email_content`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 20, + "last": 41 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "ALGORITHM", + "equals": true, + "expr": "UNDEFINED", + "value": "UNDEFINED" + }, + "4": { + "name": "DEFINER", + "equals": true, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "root@localhost", + "expr": "`root`@`localhost`", + "alias": null, + "function": null, + "subquery": null + }, + "value": "`root`@`localhost`" + }, + "5": { + "name": "SQL SECURITY", + "equals": false, + "expr": "DEFINER", + "value": "DEFINER" + }, + "6": "VIEW" + } + }, + "first": 0, + "last": 41 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateViewWithWrongSyntax.out b/tests/data/parser/parseCreateViewWithWrongSyntax.out index dc8769d6f..ca2f3d9c9 100644 --- a/tests/data/parser/parseCreateViewWithWrongSyntax.out +++ b/tests/data/parser/parseCreateViewWithWrongSyntax.out @@ -1 +1,1006 @@ -a:4:{s:5:"query";s:38:"CREATE VIEW abc AS SELECT a, b, FROM a";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:38:"CREATE VIEW abc AS SELECT a, b, FROM a";s:3:"len";i:38;s:4:"last";i:38;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:20:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"abc";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:32;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:37;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:20;s:3:"idx";i:20;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"abc";s:6:"column";N;s:4:"expr";s:3:"abc";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"b";s:4:"expr";s:1:"b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:8;s:4:"last";i:18;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:6;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:27:"An expression was expected.";i:1;r:121;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "CREATE VIEW abc AS SELECT a, b, FROM a", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE VIEW abc AS SELECT a, b, FROM a", + "len": 38, + "last": 38, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abc", + "value": "abc", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 20, + "idx": 20 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "abc", + "column": null, + "expr": "abc", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "b", + "expr": "b", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 8, + "last": 18 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "6": "VIEW" + } + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An expression was expected.", + { + "@type": "@18" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseCreateViewWithoutQuotes.out b/tests/data/parser/parseCreateViewWithoutQuotes.out index e2925ca73..1797d4b27 100644 --- a/tests/data/parser/parseCreateViewWithoutQuotes.out +++ b/tests/data/parser/parseCreateViewWithoutQuotes.out @@ -1,10 +1,1263 @@ -a:4:{s:5:"query";s:207:"CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost -SQL SECURITY DEFINER VIEW `test_view` AS -select `email_content`.`content_id` AS `content_id`, -`email_content`.`brand_id` AS `brand_id` from `email_content`;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:207:"CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost -SQL SECURITY DEFINER VIEW `test_view` AS -select `email_content`.`content_id` AS `content_id`, -`email_content`.`brand_id` AS `brand_id` from `email_content`;";s:3:"len";i:207;s:4:"last";i:207;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:45:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"CREATE";s:5:"value";s:6:"CREATE";s:7:"keyword";s:6:"CREATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"ALGORITHM";s:5:"value";s:9:"ALGORITHM";s:7:"keyword";s:9:"ALGORITHM";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";s:7:"keyword";s:9:"UNDEFINED";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";s:7:"keyword";s:7:"DEFINER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"root";s:5:"value";s:4:"root";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"@localhost";s:5:"value";s:9:"localhost";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:39;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"SQL SECURITY";s:5:"value";s:12:"SQL SECURITY";s:7:"keyword";s:12:"SQL SECURITY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";s:7:"keyword";s:7:"DEFINER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:63;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"VIEW";s:5:"value";s:4:"VIEW";s:7:"keyword";s:4:"VIEW";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:71;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`test_view`";s:5:"value";s:9:"test_view";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:76;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:92;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:99;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:114;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`content_id`";s:5:"value";s:10:"content_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:115;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:128;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`content_id`";s:5:"value";s:10:"content_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:131;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:143;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:144;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:145;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:160;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`brand_id`";s:5:"value";s:8:"brand_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:161;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:171;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:172;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:174;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`brand_id`";s:5:"value";s:8:"brand_id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:175;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:185;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:186;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:190;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"`email_content`";s:5:"value";s:13:"email_content";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:191;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:206;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:45;s:3:"idx";i:45;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\CreateStatement":17:{s:4:"name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"test_view";s:6:"column";N;s:4:"expr";s:11:"`test_view`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:13:"entityOptions";N;s:6:"fields";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";s:10:"content_id";s:4:"expr";s:28:"`email_content`.`content_id`";s:5:"alias";s:10:"content_id";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";s:8:"brand_id";s:4:"expr";s:26:"`email_content`.`brand_id`";s:5:"alias";s:8:"brand_id";s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:13:"email_content";s:6:"column";N;s:4:"expr";s:15:"`email_content`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:21;s:4:"last";i:42;}s:4:"like";N;s:11:"partitionBy";N;s:13:"partitionsNum";N;s:14:"subpartitionBy";N;s:16:"subpartitionsNum";N;s:10:"partitions";N;s:5:"table";N;s:6:"return";N;s:10:"parameters";N;s:4:"body";a:0:{}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:4:{i:3;a:4:{s:4:"name";s:9:"ALGORITHM";s:6:"equals";b:1;s:4:"expr";s:9:"UNDEFINED";s:5:"value";s:9:"UNDEFINED";}i:4;a:4:{s:4:"name";s:7:"DEFINER";s:6:"equals";b:1;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"root";s:4:"expr";s:14:"root@localhost";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:14:"root@localhost";}i:5;a:4:{s:4:"name";s:12:"SQL SECURITY";s:6:"equals";b:0;s:4:"expr";s:7:"DEFINER";s:5:"value";s:7:"DEFINER";}i:6;s:4:"VIEW";}}s:5:"first";i:0;s:4:"last";i:42;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost\nSQL SECURITY DEFINER VIEW `test_view` AS\nselect `email_content`.`content_id` AS `content_id`,\n`email_content`.`brand_id` AS `brand_id` from `email_content`;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost\nSQL SECURITY DEFINER VIEW `test_view` AS\nselect `email_content`.`content_id` AS `content_id`,\n`email_content`.`brand_id` AS `brand_id` from `email_content`;", + "len": 207, + "last": 207, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CREATE", + "value": "CREATE", + "keyword": "CREATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALGORITHM", + "value": "ALGORITHM", + "keyword": "ALGORITHM", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNDEFINED", + "value": "UNDEFINED", + "keyword": "UNDEFINED", + "type": 1, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFINER", + "value": "DEFINER", + "keyword": "DEFINER", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "root", + "value": "root", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@localhost", + "value": "localhost", + "keyword": null, + "type": 8, + "flags": 1, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SQL SECURITY", + "value": "SQL SECURITY", + "keyword": "SQL SECURITY", + "type": 1, + "flags": 7, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFINER", + "value": "DEFINER", + "keyword": "DEFINER", + "type": 1, + "flags": 1, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VIEW", + "value": "VIEW", + "keyword": "VIEW", + "type": 1, + "flags": 1, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`test_view`", + "value": "test_view", + "keyword": null, + "type": 8, + "flags": 2, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`content_id`", + "value": "content_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`content_id`", + "value": "content_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`brand_id`", + "value": "brand_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`brand_id`", + "value": "brand_id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 185 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 186 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 190 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`email_content`", + "value": "email_content", + "keyword": null, + "type": 8, + "flags": 2, + "position": 191 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 206 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 45, + "idx": 45 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "OPTIONS": { + "TEMPORARY": 1, + "OR REPLACE": 2, + "ALGORITHM": [ + 3, + "var=" + ], + "DEFINER": [ + 4, + "expr=" + ], + "SQL SECURITY": [ + 5, + "var" + ], + "DATABASE": 6, + "EVENT": 6, + "FUNCTION": 6, + "INDEX": 6, + "UNIQUE INDEX": 6, + "FULLTEXT INDEX": 6, + "SPATIAL INDEX": 6, + "PROCEDURE": 6, + "SERVER": 6, + "TABLE": 6, + "TABLESPACE": 6, + "TRIGGER": 6, + "USER": 6, + "VIEW": 6, + "SCHEMA": 6, + "IF NOT EXISTS": 7 + }, + "DB_OPTIONS": { + "CHARACTER SET": [ + 1, + "var=" + ], + "CHARSET": [ + 1, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 1, + "var=" + ], + "DEFAULT CHARSET": [ + 1, + "var=" + ], + "DEFAULT COLLATE": [ + 2, + "var=" + ], + "COLLATE": [ + 2, + "var=" + ] + }, + "TABLE_OPTIONS": { + "ENGINE": [ + 1, + "var=" + ], + "AUTO_INCREMENT": [ + 2, + "var=" + ], + "AVG_ROW_LENGTH": [ + 3, + "var" + ], + "CHARACTER SET": [ + 4, + "var=" + ], + "CHARSET": [ + 4, + "var=" + ], + "DEFAULT CHARACTER SET": [ + 4, + "var=" + ], + "DEFAULT CHARSET": [ + 4, + "var=" + ], + "CHECKSUM": [ + 5, + "var" + ], + "DEFAULT COLLATE": [ + 6, + "var=" + ], + "COLLATE": [ + 6, + "var=" + ], + "COMMENT": [ + 7, + "var=" + ], + "CONNECTION": [ + 8, + "var" + ], + "DATA DIRECTORY": [ + 9, + "var" + ], + "DELAY_KEY_WRITE": [ + 10, + "var" + ], + "INDEX DIRECTORY": [ + 11, + "var" + ], + "INSERT_METHOD": [ + 12, + "var" + ], + "KEY_BLOCK_SIZE": [ + 13, + "var" + ], + "MAX_ROWS": [ + 14, + "var" + ], + "MIN_ROWS": [ + 15, + "var" + ], + "PACK_KEYS": [ + 16, + "var" + ], + "PASSWORD": [ + 17, + "var" + ], + "ROW_FORMAT": [ + 18, + "var" + ], + "TABLESPACE": [ + 19, + "var" + ], + "STORAGE": [ + 20, + "var" + ], + "UNION": [ + 21, + "var" + ] + }, + "FUNC_OPTIONS": { + "COMMENT": [ + 1, + "var=" + ], + "LANGUAGE SQL": 2, + "DETERMINISTIC": 3, + "NOT DETERMINISTIC": 3, + "CONTAINS SQL": 4, + "NO SQL": 4, + "READS SQL DATA": 4, + "MODIFIES SQL DATA": 4, + "SQL SECURITY DEFINER": [ + 5, + "var" + ] + }, + "TRIGGER_OPTIONS": { + "BEFORE": 1, + "AFTER": 1, + "INSERT": 2, + "UPDATE": 2, + "DELETE": 2 + }, + "name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test_view", + "column": null, + "expr": "`test_view`", + "alias": null, + "function": null, + "subquery": null + }, + "entityOptions": null, + "fields": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": "content_id", + "expr": "`email_content`.`content_id`", + "alias": "content_id", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": "brand_id", + "expr": "`email_content`.`brand_id`", + "alias": "brand_id", + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "email_content", + "column": null, + "expr": "`email_content`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 21, + "last": 42 + }, + "like": null, + "partitionBy": null, + "partitionsNum": null, + "subpartitionBy": null, + "subpartitionsNum": null, + "partitions": null, + "table": null, + "return": null, + "parameters": null, + "body": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "ALGORITHM", + "equals": true, + "expr": "UNDEFINED", + "value": "UNDEFINED" + }, + "4": { + "name": "DEFINER", + "equals": true, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "root", + "expr": "root@localhost", + "alias": null, + "function": null, + "subquery": null + }, + "value": "root@localhost" + }, + "5": { + "name": "SQL SECURITY", + "equals": false, + "expr": "DEFINER", + "value": "DEFINER" + }, + "6": "VIEW" + } + }, + "first": 0, + "last": 42 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete.out b/tests/data/parser/parseDelete.out index a818e627a..ec6f36e37 100644 --- a/tests/data/parser/parseDelete.out +++ b/tests/data/parser/parseDelete.out @@ -1,25 +1,972 @@ -a:4:{s:5:"query";s:122:"DELETE LOW_PRIORITY -/* */ -FROM - `test`.users -WHERE - `id`<3 AND (username="Dan" or username="Paul") -ORDER BY - id -;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:122:"DELETE LOW_PRIORITY -/* */ -FROM - `test`.users -WHERE - `id`<3 AND (username="Dan" or username="Paul") -ORDER BY - id -;";s:3:"len";i:122;s:4:"last";i:122;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:38:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:20;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`test`";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:42;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:58;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"<";s:5:"value";s:1:"<";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:62;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:63;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:65;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:69;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:70;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:78;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""Dan"";s:5:"value";s:3:"Dan";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:79;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"or";s:5:"value";s:2:"OR";s:7:"keyword";s:2:"OR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:85;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:88;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:96;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Paul"";s:5:"value";s:4:"Paul";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:97;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:103;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:105;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:118;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:121;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:38;s:3:"idx";i:38;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:4:"test";s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:12:"`test`.users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:5:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:2:"id";}s:10:"isOperator";b:0;s:4:"expr";s:6:"`id`<3";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:8:"username";i:1;s:3:"Dan";}s:10:"isOperator";b:0;s:4:"expr";s:15:"(username="Dan"";}i:3;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:2:"OR";}i:4;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:8:"username";i:1;s:4:"Paul";}s:10:"isOperator";b:0;s:4:"expr";s:16:"username="Paul")";}}s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:12:"LOW_PRIORITY";}}s:5:"first";i:0;s:4:"last";i:35;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE LOW_PRIORITY\n\/* *\/\nFROM\n `test`.users\nWHERE\n `id`<3 AND (username=\"Dan\" or username=\"Paul\")\nORDER BY\n id\n;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE LOW_PRIORITY\n\/* *\/\nFROM\n `test`.users\nWHERE\n `id`<3 AND (username=\"Dan\" or username=\"Paul\")\nORDER BY\n id\n;", + "len": 122, + "last": 122, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`test`", + "value": "test", + "keyword": null, + "type": 8, + "flags": 2, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "<", + "value": "<", + "keyword": null, + "type": 2, + "flags": 2, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Dan\"", + "value": "Dan", + "keyword": null, + "type": 7, + "flags": 2, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "or", + "value": "OR", + "keyword": "OR", + "type": 1, + "flags": 3, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Paul\"", + "value": "Paul", + "keyword": null, + "type": 7, + "flags": 2, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 38, + "idx": 38 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "test", + "table": "users", + "column": null, + "expr": "`test`.users", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "id" + ], + "isOperator": false, + "expr": "`id`<3" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "username", + "Dan" + ], + "isOperator": false, + "expr": "(username=\"Dan\"" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "OR" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "username", + "Paul" + ], + "isOperator": false, + "expr": "username=\"Paul\")" + } + ], + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOW_PRIORITY" + } + }, + "first": 0, + "last": 35 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete10.out b/tests/data/parser/parseDelete10.out index c409b971b..33a20ad58 100644 --- a/tests/data/parser/parseDelete10.out +++ b/tests/data/parser/parseDelete10.out @@ -1 +1,820 @@ -a:4:{s:5:"query";s:71:"DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2 WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:71:"DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2 WHERE 1=1";s:3:"len";i:71;s:4:"last";i:71;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:32:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:62;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:68;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:69;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:32;s:3:"idx";i:32;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table1";s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:8:"table2.*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2 WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2 WHERE 1=1", + "len": 71, + "last": 71, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 32, + "idx": 32 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table1", + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2.*", + "alias": null, + "function": null, + "subquery": null + } + ], + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete11.out b/tests/data/parser/parseDelete11.out index 4daf758ac..0642cfa14 100644 --- a/tests/data/parser/parseDelete11.out +++ b/tests/data/parser/parseDelete11.out @@ -1 +1,838 @@ -a:4:{s:5:"query";s:81:"DELETE QUICK FROM table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:81:"DELETE QUICK FROM table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1";s:3:"len";i:81;s:4:"last";i:81;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:48;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:51;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:57;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:64;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:67;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:72;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:78;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:79;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:80;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:6:"table2";s:5:"table";N;s:6:"column";N;s:4:"expr";s:8:"table2.*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table1";s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table2";s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1", + "len": 81, + "last": 81, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 34 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "table2", + "table": null, + "column": null, + "expr": "table2.*", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table1", + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table2", + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete12.out b/tests/data/parser/parseDelete12.out index a4066ac88..34e8b6527 100644 --- a/tests/data/parser/parseDelete12.out +++ b/tests/data/parser/parseDelete12.out @@ -1 +1,655 @@ -a:4:{s:5:"query";s:46:"DELETE QUICK FROM table1 WHERE 1=1 LIMIT 0, 25";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:46:"DELETE QUICK FROM table1 WHERE 1=1 LIMIT 0, 25";s:3:"len";i:46;s:4:"last";i:46;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"25";s:5:"value";i:25;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:44;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:25;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:19;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1 WHERE 1=1 LIMIT 0, 25", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1 WHERE 1=1 LIMIT 0, 25", + "len": 46, + "last": 46, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "25", + "value": 25, + "keyword": null, + "type": 6, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 25 + }, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 19 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete2.out b/tests/data/parser/parseDelete2.out index 915aa351f..73d801f34 100644 --- a/tests/data/parser/parseDelete2.out +++ b/tests/data/parser/parseDelete2.out @@ -1 +1,500 @@ -a:4:{s:5:"query";s:21:"DELETE IGNORE FROM t1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:21:"DELETE IGNORE FROM t1";s:3:"len";i:21;s:4:"last";i:21;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:8;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1", + "len": 21, + "last": 21, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 8 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 6 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete3.out b/tests/data/parser/parseDelete3.out index d8b87996c..34e89e981 100644 --- a/tests/data/parser/parseDelete3.out +++ b/tests/data/parser/parseDelete3.out @@ -1 +1,588 @@ -a:4:{s:5:"query";s:31:"DELETE IGNORE FROM t1 WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:31:"DELETE IGNORE FROM t1 WHERE 1=1";s:3:"len";i:31;s:4:"last";i:31;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:12;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 WHERE 1=1", + "len": 31, + "last": 31, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 12 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete4.out b/tests/data/parser/parseDelete4.out index 4a5d3d6d4..e68eedc31 100644 --- a/tests/data/parser/parseDelete4.out +++ b/tests/data/parser/parseDelete4.out @@ -1 +1,652 @@ -a:4:{s:5:"query";s:43:"DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:41;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete5.out b/tests/data/parser/parseDelete5.out index 6e470ea60..79e138aa6 100644 --- a/tests/data/parser/parseDelete5.out +++ b/tests/data/parser/parseDelete5.out @@ -1 +1,710 @@ -a:4:{s:5:"query";s:54:"DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id LIMIT 0,25";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:54:"DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id LIMIT 0,25";s:3:"len";i:54;s:4:"last";i:54;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:41;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:44;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:50;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:51;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"25";s:5:"value";i:25;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:25;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:22;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id LIMIT 0,25", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 WHERE 1=1 ORDER BY id LIMIT 0,25", + "len": 54, + "last": 54, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "25", + "value": 25, + "keyword": null, + "type": 6, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 25 + }, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 22 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete6.out b/tests/data/parser/parseDelete6.out index bcecfc2a7..05fd27bd7 100644 --- a/tests/data/parser/parseDelete6.out +++ b/tests/data/parser/parseDelete6.out @@ -1 +1,564 @@ -a:4:{s:5:"query";s:33:"DELETE IGNORE FROM t1 ORDER BY id";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:33:"DELETE IGNORE FROM t1 ORDER BY id";s:3:"len";i:33;s:4:"last";i:33;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:12:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:12;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 ORDER BY id", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 ORDER BY id", + "len": 33, + "last": 33, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 12, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete7.out b/tests/data/parser/parseDelete7.out index 5ed2c9ef8..d4fcfdbb9 100644 --- a/tests/data/parser/parseDelete7.out +++ b/tests/data/parser/parseDelete7.out @@ -1 +1,622 @@ -a:4:{s:5:"query";s:44:"DELETE IGNORE FROM t1 ORDER BY id LIMIT 0,25";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:44:"DELETE IGNORE FROM t1 ORDER BY id LIMIT 0,25";s:3:"len";i:44;s:4:"last";i:44;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"25";s:5:"value";i:25;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:25;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 ORDER BY id LIMIT 0,25", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 ORDER BY id LIMIT 0,25", + "len": 44, + "last": 44, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "25", + "value": 25, + "keyword": null, + "type": 6, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 25 + }, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete8.out b/tests/data/parser/parseDelete8.out index 290d3aa01..4d0c341b5 100644 --- a/tests/data/parser/parseDelete8.out +++ b/tests/data/parser/parseDelete8.out @@ -1 +1,567 @@ -a:4:{s:5:"query";s:33:"DELETE IGNORE FROM t1 LIMIT 0, 25";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:33:"DELETE IGNORE FROM t1 LIMIT 0, 25";s:3:"len";i:33;s:4:"last";i:33;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"25";s:5:"value";i:25;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:25;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;s:6:"IGNORE";}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE IGNORE FROM t1 LIMIT 0, 25", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE IGNORE FROM t1 LIMIT 0, 25", + "len": 33, + "last": 33, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "25", + "value": 25, + "keyword": null, + "type": 6, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 25 + }, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": "IGNORE" + } + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelete9.out b/tests/data/parser/parseDelete9.out index 9b783406e..3e55a91d8 100644 --- a/tests/data/parser/parseDelete9.out +++ b/tests/data/parser/parseDelete9.out @@ -1 +1,732 @@ -a:4:{s:5:"query";s:61:"DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:61:"DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2";s:3:"len";i:61;s:4:"last";i:61;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:26;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table1";s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:8:"table2.*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:24;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK table1, table2.* FROM table1 as t1, table2 as t2", + "len": 61, + "last": 61, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 26 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table1", + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2.*", + "alias": null, + "function": null, + "subquery": null + } + ], + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 24 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr1.out b/tests/data/parser/parseDeleteErr1.out index b35effa77..ba2f34513 100644 --- a/tests/data/parser/parseDeleteErr1.out +++ b/tests/data/parser/parseDeleteErr1.out @@ -1 +1,536 @@ -a:4:{s:5:"query";s:35:"DELETE QUICK USING table1, table2.*";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:35:"DELETE QUICK USING table1, table2.*";s:3:"len";i:35;s:4:"last";i:35;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:34;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";N;s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK USING table1, table2.*", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK USING table1, table2.*", + "len": 35, + "last": 35, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": null, + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr10.out b/tests/data/parser/parseDeleteErr10.out index 31b5fde4c..ad3f07883 100644 --- a/tests/data/parser/parseDeleteErr10.out +++ b/tests/data/parser/parseDeleteErr10.out @@ -1 +1,810 @@ -a:4:{s:5:"query";s:65:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt ASC a =1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:65:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt ASC a =1;";s:3:"len";i:65;s:4:"last";i:65;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"tt";s:5:"value";s:2:"tt";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:60;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:62;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:63;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:64;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t1";s:4:"expr";s:2:"t1";s:5:"alias";s:1:"t";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t2";s:4:"expr";s:2:"t2";s:5:"alias";s:2:"tt";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:24;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:184;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:184;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt ASC a =1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt ASC a =1;", + "len": 65, + "last": 65, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tt", + "value": "tt", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t1", + "expr": "t1", + "alias": "t", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t2", + "expr": "t2", + "alias": "tt", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 24 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@27" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@27" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr11.out b/tests/data/parser/parseDeleteErr11.out index a96e5c103..13691ae30 100644 --- a/tests/data/parser/parseDeleteErr11.out +++ b/tests/data/parser/parseDeleteErr11.out @@ -1 +1,641 @@ -a:4:{s:5:"query";s:40:"DELETE QUICK FROM table1 WHERE a = 1 ASC";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:40:"DELETE QUICK FROM table1 WHERE a = 1 ASC";s:3:"len";i:40;s:4:"last";i:40;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:37;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:19;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:1:"a";}s:10:"isOperator";b:0;s:4:"expr";s:5:"a = 1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:121;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:121;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1 WHERE a = 1 ASC", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1 WHERE a = 1 ASC", + "len": 40, + "last": 40, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 19 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "a" + ], + "isOperator": false, + "expr": "a = 1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@18" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@18" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr12.out b/tests/data/parser/parseDeleteErr12.out index a596f4414..be99bb83e 100644 --- a/tests/data/parser/parseDeleteErr12.out +++ b/tests/data/parser/parseDeleteErr12.out @@ -1,4 +1,890 @@ -a:4:{s:5:"query";s:74:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt as ttt WHEE a =1; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:74:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt as ttt WHEE a =1; -";s:3:"len";i:74;s:4:"last";i:74;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:38:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"tt";s:5:"value";s:2:"tt";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ttt";s:5:"value";s:3:"ttt";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"WHEE";s:5:"value";s:4:"WHEE";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:63;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:68;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:70;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:71;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:72;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:38;s:3:"idx";i:38;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t1";s:4:"expr";s:2:"t1";s:5:"alias";s:1:"t";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t2";s:4:"expr";s:2:"t2";s:5:"alias";s:2:"tt";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:26;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:7:{i:0;a:3:{i:0;s:30:"An alias was previously found.";i:1;r:198;i:2;i:0;}i:1;a:3:{i:0;s:22:"An alias was expected.";i:1;r:191;i:2;i:0;}i:2;a:3:{i:0;s:17:"Unexpected token.";i:1;r:198;i:2;i:0;}i:3;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:198;i:2;i:0;}i:4;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:212;i:2;i:0;}i:5;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:226;i:2;i:0;}i:6;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:247;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt as ttt WHEE a =1;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt as ttt WHEE a =1;\n", + "len": 74, + "last": 74, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tt", + "value": "tt", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ttt", + "value": "ttt", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHEE", + "value": "WHEE", + "keyword": null, + "type": 0, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 38, + "idx": 38 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t1", + "expr": "t1", + "alias": "t", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t2", + "expr": "t2", + "alias": "tt", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 26 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was previously found.", + { + "@type": "@29" + }, + 0 + ], + [ + "An alias was expected.", + { + "@type": "@28" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@29" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@29" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@31" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@36" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr2.out b/tests/data/parser/parseDeleteErr2.out index cbf268a52..659b2bfb5 100644 --- a/tests/data/parser/parseDeleteErr2.out +++ b/tests/data/parser/parseDeleteErr2.out @@ -1 +1,754 @@ -a:4:{s:5:"query";s:76:"DELETE QUICK table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:76:"DELETE QUICK table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1";s:3:"len";i:76;s:4:"last";i:76;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:32:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:52;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:62;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:67;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:73;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:74;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:75;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:32;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";N;s:4:"join";N;s:5:"using";N;s:7:"columns";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table1";s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:8:"table2.*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:86;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:86;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK table1, table2.* USING table1 AS `t1`, table2 AS `t2` WHERE 1=1", + "len": 76, + "last": 76, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 32, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": null, + "join": null, + "using": null, + "columns": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table1", + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2.*", + "alias": null, + "function": null, + "subquery": null + } + ], + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@13" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@13" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr3.out b/tests/data/parser/parseDeleteErr3.out index b58803c31..140419c30 100644 --- a/tests/data/parser/parseDeleteErr3.out +++ b/tests/data/parser/parseDeleteErr3.out @@ -1 +1,741 @@ -a:4:{s:5:"query";s:69:"DELETE QUICK table1, table2.* table1 AS `t1` table2 AS `t2` WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:69:"DELETE QUICK table1, table2.* table1 AS `t1` table2 AS `t2` WHERE 1=1";s:3:"len";i:69;s:4:"last";i:69;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:55;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:60;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:67;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:68;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:30;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";N;s:4:"join";N;s:5:"using";N;s:7:"columns";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table1";s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:15:"table2.* table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:30:"An alias was previously found.";i:1;r:128;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:128;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:128;i:2;i:0;}i:3;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:142;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK table1, table2.* table1 AS `t1` table2 AS `t2` WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK table1, table2.* table1 AS `t1` table2 AS `t2` WHERE 1=1", + "len": 69, + "last": 69, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 30 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": null, + "join": null, + "using": null, + "columns": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table1", + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2.* table1", + "alias": "t1", + "function": null, + "subquery": null + } + ], + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was previously found.", + { + "@type": "@19" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@19" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@19" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@21" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr4.out b/tests/data/parser/parseDeleteErr4.out index b21f45e08..c21034b67 100644 --- a/tests/data/parser/parseDeleteErr4.out +++ b/tests/data/parser/parseDeleteErr4.out @@ -1 +1,875 @@ -a:4:{s:5:"query";s:96:"DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 ORDER BY id ASC";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:96:"DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 ORDER BY id ASC";s:3:"len";i:96;s:4:"last";i:96;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:39:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:77;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:78;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:79;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:81;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:90;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:39;s:3:"idx";i:40;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:6:"table2";s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"table2.* table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table2";s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:56:"This type of clause is not valid in Multi-table queries.";i:1;r:240;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:240;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 ORDER BY id ASC", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 ORDER BY id ASC", + "len": 96, + "last": 96, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 39, + "idx": 40 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "table2", + "table": null, + "column": null, + "expr": "table2.* table1", + "alias": "t1", + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table2", + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This type of clause is not valid in Multi-table queries.", + { + "@type": "@35" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@35" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr5.out b/tests/data/parser/parseDeleteErr5.out index 65b6cc5fe..9f0eb66dd 100644 --- a/tests/data/parser/parseDeleteErr5.out +++ b/tests/data/parser/parseDeleteErr5.out @@ -1 +1,739 @@ -a:4:{s:5:"query";s:60:"DELETE QUICK FROM table1 WHERE 1=1 ORDER BY id ASC WHERE 1=1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:60:"DELETE QUICK FROM table1 WHERE 1=1 ORDER BY id ASC WHERE 1=1";s:3:"len";i:60;s:4:"last";i:60;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:51;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:57;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:58;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:59;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:27;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:19;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:149;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:149;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1 WHERE 1=1 ORDER BY id ASC WHERE 1=1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1 WHERE 1=1 ORDER BY id ASC WHERE 1=1", + "len": 60, + "last": 60, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 27 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 19 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@22" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@22" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr6.out b/tests/data/parser/parseDeleteErr6.out index 492465d58..596020106 100644 --- a/tests/data/parser/parseDeleteErr6.out +++ b/tests/data/parser/parseDeleteErr6.out @@ -1 +1,884 @@ -a:4:{s:5:"query";s:92:"DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 LIMIT 0, 25";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:92:"DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 LIMIT 0, 25";s:3:"len";i:92;s:4:"last";i:92;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:40:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:77;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:78;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:79;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:81;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"25";s:5:"value";i:25;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:90;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:40;s:3:"idx";i:41;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:6:"table2";s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"table2.* table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:6:"table2";s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:56:"This type of clause is not valid in Multi-table queries.";i:1;r:240;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:240;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 LIMIT 0, 25", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2.* table1 AS `t1` USING table2 AS `t2` WHERE 1=1 LIMIT 0, 25", + "len": 92, + "last": 92, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "25", + "value": 25, + "keyword": null, + "type": 6, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 40, + "idx": 41 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "table2", + "table": null, + "column": null, + "expr": "table2.* table1", + "alias": "t1", + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "table2", + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This type of clause is not valid in Multi-table queries.", + { + "@type": "@35" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@35" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr7.out b/tests/data/parser/parseDeleteErr7.out index 3f5fdc279..c52857b49 100644 --- a/tests/data/parser/parseDeleteErr7.out +++ b/tests/data/parser/parseDeleteErr7.out @@ -1 +1,723 @@ -a:4:{s:5:"query";s:58:"DELETE QUICK FROM table1 WHERE a = 1 ORDER BY id ASC WHERE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:58:"DELETE QUICK FROM table1 WHERE a = 1 ORDER BY id ASC WHERE";s:3:"len";i:58;s:4:"last";i:58;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:37;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:53;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:25;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:1:"a";}s:10:"isOperator";b:0;s:4:"expr";s:5:"a = 1";}}s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:163;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:163;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1 WHERE a = 1 ORDER BY id ASC WHERE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1 WHERE a = 1 ORDER BY id ASC WHERE", + "len": 58, + "last": 58, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 25 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "a" + ], + "isOperator": false, + "expr": "a = 1" + } + ], + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@24" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@24" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr8.out b/tests/data/parser/parseDeleteErr8.out index 1ccf5abd1..684c526dc 100644 --- a/tests/data/parser/parseDeleteErr8.out +++ b/tests/data/parser/parseDeleteErr8.out @@ -1 +1,533 @@ -a:4:{s:5:"query";s:28:"DELETE QUICK FROM table1 ASC";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:28:"DELETE QUICK FROM table1 ASC";s:3:"len";i:28;s:4:"last";i:28;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";N;s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:65;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1 ASC", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1 ASC", + "len": 28, + "last": 28, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": null, + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@10" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteErr9.out b/tests/data/parser/parseDeleteErr9.out index b30d925ce..4d895cf63 100644 --- a/tests/data/parser/parseDeleteErr9.out +++ b/tests/data/parser/parseDeleteErr9.out @@ -1 +1,831 @@ -a:4:{s:5:"query";s:66:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt WHEE a =1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:66:"DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt WHEE a =1;";s:3:"len";i:66;s:4:"last";i:66;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"QUICK";s:5:"value";s:5:"QUICK";s:7:"keyword";s:5:"QUICK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"USING";s:5:"value";s:5:"USING";s:7:"keyword";s:5:"USING";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"tt";s:5:"value";s:2:"tt";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"WHEE";s:5:"value";s:4:"WHEE";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:56;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:63;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:64;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:65;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";N;s:5:"using";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t1";s:4:"expr";s:2:"t1";s:5:"alias";s:1:"t";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t2";s:4:"expr";s:2:"t2";s:5:"alias";s:2:"tt";s:8:"function";N;s:8:"subquery";N;}}s:7:"columns";N;s:9:"partition";N;s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;s:5:"QUICK";}}s:5:"first";i:0;s:4:"last";i:24;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:5:{i:0;a:3:{i:0;s:30:"An alias was previously found.";i:1;r:184;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:184;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:184;i:2;i:0;}i:3;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:198;i:2;i:0;}i:4;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:219;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt WHEE a =1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE QUICK FROM table1, table2 USING t1 as t,t2 as tt WHEE a =1;", + "len": 66, + "last": 66, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "QUICK", + "value": "QUICK", + "keyword": "QUICK", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USING", + "value": "USING", + "keyword": "USING", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tt", + "value": "tt", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHEE", + "value": "WHEE", + "keyword": null, + "type": 0, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": null, + "using": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t1", + "expr": "t1", + "alias": "t", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t2", + "expr": "t2", + "alias": "tt", + "function": null, + "subquery": null + } + ], + "columns": null, + "partition": null, + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": "QUICK" + } + }, + "first": 0, + "last": 24 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was previously found.", + { + "@type": "@27" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@27" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@27" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@29" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@32" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDeleteJoin.out b/tests/data/parser/parseDeleteJoin.out index 5db0fdc13..23fa795f7 100644 --- a/tests/data/parser/parseDeleteJoin.out +++ b/tests/data/parser/parseDeleteJoin.out @@ -1 +1,1025 @@ -a:4:{s:5:"query";s:83:"DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:83:"DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id";s:3:"len";i:83;s:4:"last";i:83;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:39:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"DELETE";s:5:"value";s:6:"DELETE";s:7:"keyword";s:6:"DELETE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"INNER JOIN";s:5:"value";s:10:"INNER JOIN";s:7:"keyword";s:10:"INNER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:22;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"INNER JOIN";s:5:"value";s:10:"INNER JOIN";s:7:"keyword";s:10:"INNER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:36;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:58;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:61;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:62;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:68;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:72;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:74;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:77;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:81;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:39;s:3:"idx";i:39;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\DeleteStatement":11:{s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"join";a:2:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:5:"INNER";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t2";s:6:"column";N;s:4:"expr";s:2:"t2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}i:1;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:5:"INNER";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t3";s:6:"column";N;s:4:"expr";s:2:"t3";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"using";N;s:7:"columns";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t1";s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"t2";s:4:"expr";s:2:"t2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:9:"partition";N;s:5:"where";a:3:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t1";i:1;s:2:"id";i:2;s:2:"t2";}s:10:"isOperator";b:0;s:4:"expr";s:11:"t1.id=t2.id";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t2";i:1;s:2:"id";i:2;s:2:"t3";}s:10:"isOperator";b:0;s:4:"expr";s:11:"t2.id=t3.id";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:37;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id", + "len": 83, + "last": 83, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELETE", + "value": "DELETE", + "keyword": "DELETE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INNER JOIN", + "value": "INNER JOIN", + "keyword": "INNER JOIN", + "type": 1, + "flags": 7, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INNER JOIN", + "value": "INNER JOIN", + "keyword": "INNER JOIN", + "type": 1, + "flags": 7, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 39, + "idx": 39 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "QUICK": 2, + "IGNORE": 3 + }, + "CLAUSES": { + "DELETE": [ + "DELETE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "FROM": [ + "FROM", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "USING": [ + "USING", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "INNER", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t2", + "column": null, + "expr": "t2", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "INNER", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t3", + "column": null, + "expr": "t3", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "using": null, + "columns": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t1", + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "t2", + "expr": "t2", + "alias": null, + "function": null, + "subquery": null + } + ], + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t1", + "id", + "t2" + ], + "isOperator": false, + "expr": "t1.id=t2.id" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t2", + "id", + "t3" + ], + "isOperator": false, + "expr": "t2.id=t3.id" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 37 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDelimiter.out b/tests/data/parser/parseDelimiter.out index 565ed08f8..fe096cf04 100644 --- a/tests/data/parser/parseDelimiter.out +++ b/tests/data/parser/parseDelimiter.out @@ -1,13 +1,1314 @@ -a:4:{s:5:"query";s:82:"SELECT * FROM foo; -DELIMITER $$ -SELECT * FROM bar$$ -DELIMITER ; -SELECT * FROM baz;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:82:"SELECT * FROM foo; -DELIMITER $$ -SELECT * FROM bar$$ -DELIMITER ; -SELECT * FROM baz;";s:3:"len";i:82;s:4:"last";i:82;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:35:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"$$";s:5:"value";s:2:"$$";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:32;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:41;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:46;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"$$";s:5:"value";s:2:"$$";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DELIMITER";s:5:"value";s:9:"DELIMITER";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:52;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:62;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:64;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:81;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:35;s:3:"idx";i:35;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:3:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:6;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"bar";s:6:"column";N;s:4:"expr";s:3:"bar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:13;s:4:"last";i:19;}i:2;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"baz";s:6:"column";N;s:4:"expr";s:3:"baz";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:26;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM foo;\nDELIMITER $$\nSELECT * FROM bar$$\nDELIMITER ;\nSELECT * FROM baz;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM foo;\nDELIMITER $$\nSELECT * FROM bar$$\nDELIMITER ;\nSELECT * FROM baz;", + "len": 82, + "last": 82, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "$$", + "value": "$$", + "keyword": null, + "type": 9, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "$$", + "value": "$$", + "keyword": null, + "type": 9, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DELIMITER", + "value": "DELIMITER", + "keyword": null, + "type": 0, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 35, + "idx": 35 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "bar", + "column": null, + "expr": "bar", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 13, + "last": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "baz", + "column": null, + "expr": "baz", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 26, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDrop.out b/tests/data/parser/parseDrop.out index 0ca71e8aa..ad945d596 100644 --- a/tests/data/parser/parseDrop.out +++ b/tests/data/parser/parseDrop.out @@ -1 +1,500 @@ -a:4:{s:5:"query";s:35:"DROP USER IF EXISTS 'testtest'@'%';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:35:"DROP USER IF EXISTS 'testtest'@'%';";s:3:"len";i:35;s:4:"last";i:35;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DROP";s:5:"value";s:4:"DROP";s:7:"keyword";s:4:"DROP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"USER";s:5:"value";s:4:"USER";s:7:"keyword";s:4:"USER";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"IF EXISTS";s:5:"value";s:9:"IF EXISTS";s:7:"keyword";s:9:"IF EXISTS";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"'testtest'@'%'";s:5:"value";s:10:"testtest@%";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:4;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\DropStatement":5:{s:6:"fields";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"testtest@%";s:6:"column";N;s:4:"expr";s:14:"'testtest'@'%'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:5:"table";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:4:"USER";i:3;s:9:"IF EXISTS";}}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DROP USER IF EXISTS 'testtest'@'%';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DROP USER IF EXISTS 'testtest'@'%';", + "len": 35, + "last": 35, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DROP", + "value": "DROP", + "keyword": "DROP", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USER", + "value": "USER", + "keyword": "USER", + "type": 1, + "flags": 33, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IF EXISTS", + "value": "IF EXISTS", + "keyword": "IF EXISTS", + "type": 1, + "flags": 7, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'testtest'@'%'", + "value": "testtest@%", + "keyword": null, + "type": 8, + "flags": 4, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "OPTIONS": { + "DATABASE": 1, + "EVENT": 1, + "FUNCTION": 1, + "INDEX": 1, + "LOGFILE": 1, + "PROCEDURE": 1, + "SCHEMA": 1, + "SERVER": 1, + "TABLE": 1, + "VIEW": 1, + "TABLESPACE": 1, + "TRIGGER": 1, + "USER": 1, + "TEMPORARY": 2, + "IF EXISTS": 3 + }, + "CLAUSES": { + "DROP": [ + "DROP", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "DROP_": [ + "DROP", + 1 + ], + "ON": [ + "ON", + 3 + ] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "testtest@%", + "column": null, + "expr": "'testtest'@'%'", + "alias": null, + "function": null, + "subquery": null + } + ], + "table": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "USER", + "3": "IF EXISTS" + } + }, + "first": 0, + "last": 6 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseDrop2.out b/tests/data/parser/parseDrop2.out index efd040de5..5f15c6a21 100644 --- a/tests/data/parser/parseDrop2.out +++ b/tests/data/parser/parseDrop2.out @@ -1 +1,481 @@ -a:4:{s:5:"query";s:25:"DROP USER 'testtest'@'%';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:25:"DROP USER 'testtest'@'%';";s:3:"len";i:25;s:4:"last";i:25;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:7:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DROP";s:5:"value";s:4:"DROP";s:7:"keyword";s:4:"DROP";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"USER";s:5:"value";s:4:"USER";s:7:"keyword";s:4:"USER";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"'testtest'@'%'";s:5:"value";s:10:"testtest@%";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:4;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:24;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:7;s:3:"idx";i:7;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\DropStatement":5:{s:6:"fields";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"testtest@%";s:6:"column";N;s:4:"expr";s:14:"'testtest'@'%'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:5:"table";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:4:"USER";}}s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "DROP USER 'testtest'@'%';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "DROP USER 'testtest'@'%';", + "len": 25, + "last": 25, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DROP", + "value": "DROP", + "keyword": "DROP", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USER", + "value": "USER", + "keyword": "USER", + "type": 1, + "flags": 33, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'testtest'@'%'", + "value": "testtest@%", + "keyword": null, + "type": 8, + "flags": 4, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 7, + "idx": 7 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "OPTIONS": { + "DATABASE": 1, + "EVENT": 1, + "FUNCTION": 1, + "INDEX": 1, + "LOGFILE": 1, + "PROCEDURE": 1, + "SCHEMA": 1, + "SERVER": 1, + "TABLE": 1, + "VIEW": 1, + "TABLESPACE": 1, + "TRIGGER": 1, + "USER": 1, + "TEMPORARY": 2, + "IF EXISTS": 3 + }, + "CLAUSES": { + "DROP": [ + "DROP", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "DROP_": [ + "DROP", + 1 + ], + "ON": [ + "ON", + 3 + ] + }, + "fields": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "testtest@%", + "column": null, + "expr": "'testtest'@'%'", + "alias": null, + "function": null, + "subquery": null + } + ], + "table": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "USER" + } + }, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseExplain.out b/tests/data/parser/parseExplain.out index 74689a690..86e78cf57 100644 --- a/tests/data/parser/parseExplain.out +++ b/tests/data/parser/parseExplain.out @@ -1 +1,482 @@ -a:4:{s:5:"query";s:27:"EXPLAIN SELECT * FROM test;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:27:"EXPLAIN SELECT * FROM test;";s:3:"len";i:27;s:4:"last";i:27;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"EXPLAIN";s:5:"value";s:7:"EXPLAIN";s:7:"keyword";s:7:"EXPLAIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ExplainStatement":4:{s:7:"unknown";a:9:{i:0;r:9;i:1;r:16;i:2;r:23;i:3;r:30;i:4;r:37;i:5;r:44;i:6;r:51;i:7;r:58;i:8;r:65;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "EXPLAIN SELECT * FROM test;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "EXPLAIN SELECT * FROM test;", + "len": 27, + "last": 27, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "EXPLAIN", + "value": "EXPLAIN", + "keyword": "EXPLAIN", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "unknown": [ + { + "@type": "@2" + }, + { + "@type": "@3" + }, + { + "@type": "@4" + }, + { + "@type": "@5" + }, + { + "@type": "@6" + }, + { + "@type": "@7" + }, + { + "@type": "@8" + }, + { + "@type": "@9" + }, + { + "@type": "@10" + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsert.out b/tests/data/parser/parseInsert.out index f968f0796..c0d8719b7 100644 --- a/tests/data/parser/parseInsert.out +++ b/tests/data/parser/parseInsert.out @@ -1,16 +1,825 @@ -a:4:{s:5:"query";s:176:"INSERT LOW_PRIORITY -INTO - users(`id`, `username`, `password`) -VALUES - (1, "Dan", "5d41402abc4b2a76b9719d911017c592"), - (2, "Paul", "7d793037a0760186574b0282f2f435e7");";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:176:"INSERT LOW_PRIORITY -INTO - users(`id`, `username`, `password`) -VALUES - (1, "Dan", "5d41402abc4b2a76b9719d911017c592"), - (2, "Paul", "7d793037a0760186574b0282f2f435e7");";s:3:"len";i:176;s:4:"last";i:176;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:41:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:35;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:39;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`username`";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"`password`";s:5:"value";s:8:"password";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:53;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:65;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:76;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:77;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""Dan"";s:5:"value";s:3:"Dan";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:80;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:85;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:34:""5d41402abc4b2a76b9719d911017c592"";s:5:"value";s:32:"5d41402abc4b2a76b9719d911017c592";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:87;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:121;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:122;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:128;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:129;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:130;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Paul"";s:5:"value";s:4:"Paul";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:132;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:138;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:34:""7d793037a0760186574b0282f2f435e7"";s:5:"value";s:32:"7d793037a0760186574b0282f2f435e7";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:140;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:174;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:175;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:41;s:3:"idx";i:41;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:3:{i:0;s:2:"id";i:1;s:8:"username";i:2;s:8:"password";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:2:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:3:{i:0;s:1:"1";i:1;s:5:""Dan"";i:2;s:34:""5d41402abc4b2a76b9719d911017c592"";}s:6:"values";a:3:{i:0;s:1:"1";i:1;s:3:"Dan";i:2;s:32:"5d41402abc4b2a76b9719d911017c592";}}i:1;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:3:{i:0;s:1:"2";i:1;s:6:""Paul"";i:2;s:34:""7d793037a0760186574b0282f2f435e7"";}s:6:"values";a:3:{i:0;s:1:"2";i:1;s:4:"Paul";i:2;s:32:"7d793037a0760186574b0282f2f435e7";}}}s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:12:"LOW_PRIORITY";}}s:5:"first";i:0;s:4:"last";i:38;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT LOW_PRIORITY\nINTO\n users(`id`, `username`, `password`)\nVALUES\n (1, \"Dan\", \"5d41402abc4b2a76b9719d911017c592\"),\n (2, \"Paul\", \"7d793037a0760186574b0282f2f435e7\");", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT LOW_PRIORITY\nINTO\n users(`id`, `username`, `password`)\nVALUES\n (1, \"Dan\", \"5d41402abc4b2a76b9719d911017c592\"),\n (2, \"Paul\", \"7d793037a0760186574b0282f2f435e7\");", + "len": 176, + "last": 176, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`username`", + "value": "username", + "keyword": null, + "type": 8, + "flags": 2, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`password`", + "value": "password", + "keyword": null, + "type": 8, + "flags": 2, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Dan\"", + "value": "Dan", + "keyword": null, + "type": 7, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"5d41402abc4b2a76b9719d911017c592\"", + "value": "5d41402abc4b2a76b9719d911017c592", + "keyword": null, + "type": 7, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Paul\"", + "value": "Paul", + "keyword": null, + "type": 7, + "flags": 2, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"7d793037a0760186574b0282f2f435e7\"", + "value": "7d793037a0760186574b0282f2f435e7", + "keyword": null, + "type": 7, + "flags": 2, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 41, + "idx": 41 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "username", + "password" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "1", + "\"Dan\"", + "\"5d41402abc4b2a76b9719d911017c592\"" + ], + "values": [ + "1", + "Dan", + "5d41402abc4b2a76b9719d911017c592" + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "2", + "\"Paul\"", + "\"7d793037a0760186574b0282f2f435e7\"" + ], + "values": [ + "2", + "Paul", + "7d793037a0760186574b0282f2f435e7" + ] + } + ], + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOW_PRIORITY" + } + }, + "first": 0, + "last": 38 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertErr.out b/tests/data/parser/parseInsertErr.out index daa165bb0..390b63200 100644 --- a/tests/data/parser/parseInsertErr.out +++ b/tests/data/parser/parseInsertErr.out @@ -1,4 +1,597 @@ -a:4:{s:5:"query";s:14:"INSERT SELECT -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:14:"INSERT SELECT -";s:3:"len";i:14;s:4:"last";i:14;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";N;s:6:"values";N;s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:1;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:0:{}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:2;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:23;i:2;i:0;}i:1;a:3:{i:0;s:27:"An expression was expected.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "INSERT SELECT\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT SELECT\n", + "len": 14, + "last": 14, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": null, + "values": null, + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 2, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@4" + }, + 0 + ], + [ + "An expression was expected.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertErr2.out b/tests/data/parser/parseInsertErr2.out index 1a5ed1f2c..a81e40cc1 100644 --- a/tests/data/parser/parseInsertErr2.out +++ b/tests/data/parser/parseInsertErr2.out @@ -1,7 +1,519 @@ -a:4:{s:5:"query";s:24:"INSERT INTO x "string" - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:24:"INSERT INTO x "string" - -";s:3:"len";i:24;s:4:"last";i:24;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:""string"";s:5:"value";s:6:"string";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"x";s:6:"column";N;s:4:"expr";s:1:"x";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:5;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:51;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "INSERT INTO x \"string\"\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO x \"string\"\n\n", + "len": 24, + "last": 24, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 1, + "flags": 33, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"string\"", + "value": "string", + "keyword": null, + "type": 7, + "flags": 2, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "x", + "column": null, + "expr": "x", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 5 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@8" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertIntoErr.out b/tests/data/parser/parseInsertIntoErr.out index 0ea0c02e3..d9a36c4f1 100644 --- a/tests/data/parser/parseInsertIntoErr.out +++ b/tests/data/parser/parseInsertIntoErr.out @@ -1,7 +1,534 @@ -a:4:{s:5:"query";s:22:"INSERT INTO x INSERT - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:22:"INSERT INTO x INSERT - -";s:3:"len";i:22;s:4:"last";i:22;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"x";s:6:"column";N;s:4:"expr";s:1:"x";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:5;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";N;s:6:"values";N;s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:6;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "INSERT INTO x INSERT\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO x INSERT\n\n", + "len": 22, + "last": 22, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 1, + "flags": 33, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "x", + "column": null, + "expr": "x", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": null, + "values": null, + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 6, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertIntoSet.out b/tests/data/parser/parseInsertIntoSet.out index 01ccb31d3..d4c5681c9 100644 --- a/tests/data/parser/parseInsertIntoSet.out +++ b/tests/data/parser/parseInsertIntoSet.out @@ -1 +1,564 @@ -a:4:{s:5:"query";s:50:"INSERT INTO aa SET = INET6_ATON('::ffff:8.8.8.8')";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:50:"INSERT INTO aa SET = INET6_ATON('::ffff:8.8.8.8')";s:3:"len";i:50;s:4:"last";i:50;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"aa";s:5:"value";s:2:"aa";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"INET6_ATON";s:5:"value";s:10:"INET6_ATON";s:7:"keyword";s:10:"INET6_ATON";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:22;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"'::ffff:8.8.8.8'";s:5:"value";s:14:"::ffff:8.8.8.8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"aa";s:6:"column";N;s:4:"expr";s:2:"aa";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:0:"";s:5:"value";s:28:"INET6_ATON('::ffff:8.8.8.8')";}}s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO aa SET = INET6_ATON('::ffff:8.8.8.8')", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO aa SET = INET6_ATON('::ffff:8.8.8.8')", + "len": 50, + "last": 50, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "aa", + "value": "aa", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INET6_ATON", + "value": "INET6_ATON", + "keyword": "INET6_ATON", + "type": 1, + "flags": 33, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'::ffff:8.8.8.8'", + "value": "::ffff:8.8.8.8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "aa", + "column": null, + "expr": "aa", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "", + "value": "INET6_ATON('::ffff:8.8.8.8')" + } + ], + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertOnDuplicateKey.out b/tests/data/parser/parseInsertOnDuplicateKey.out index 024693c68..16f822561 100644 --- a/tests/data/parser/parseInsertOnDuplicateKey.out +++ b/tests/data/parser/parseInsertOnDuplicateKey.out @@ -1,4 +1,773 @@ -a:4:{s:5:"query";s:103:"INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh') -ON DUPLICATE KEY UPDATE `id`=412,`val`='Thresh'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:103:"INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh') -ON DUPLICATE KEY UPDATE `id`=412,`val`='Thresh'";s:3:"len";i:103;s:4:"last";i:103;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:36:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`champs`";s:5:"value";s:6:"champs";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`val`";s:5:"value";s:3:"val";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"412";s:5:"value";i:412;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'Thresh'";s:5:"value";s:6:"Thresh";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DUPLICATE";s:5:"value";s:9:"DUPLICATE";s:7:"keyword";s:9:"DUPLICATE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:69;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:80;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:84;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"412";s:5:"value";i:412;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:85;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`val`";s:5:"value";s:3:"val";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:89;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'Thresh'";s:5:"value";s:6:"Thresh";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:36;s:3:"idx";i:36;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"champs";s:6:"column";N;s:4:"expr";s:8:"`champs`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:2:{i:0;s:2:"id";i:1;s:3:"val";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:1:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:3:"412";i:1;s:8:"'Thresh'";}s:6:"values";a:2:{i:0;s:3:"412";i:1;s:6:"Thresh";}}}s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:4:"`id`";s:5:"value";s:3:"412";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:5:"`val`";s:5:"value";s:8:"'Thresh'";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:34;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh')\nON DUPLICATE KEY UPDATE `id`=412,`val`='Thresh'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh')\nON DUPLICATE KEY UPDATE `id`=412,`val`='Thresh'", + "len": 103, + "last": 103, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`champs`", + "value": "champs", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`val`", + "value": "val", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "412", + "value": 412, + "keyword": null, + "type": 6, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Thresh'", + "value": "Thresh", + "keyword": null, + "type": 7, + "flags": 1, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DUPLICATE", + "value": "DUPLICATE", + "keyword": "DUPLICATE", + "type": 1, + "flags": 1, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "412", + "value": 412, + "keyword": null, + "type": 6, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`val`", + "value": "val", + "keyword": null, + "type": 8, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Thresh'", + "value": "Thresh", + "keyword": null, + "type": 7, + "flags": 1, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 36, + "idx": 36 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "champs", + "column": null, + "expr": "`champs`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "val" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "412", + "'Thresh'" + ], + "values": [ + "412", + "Thresh" + ] + } + ], + "set": null, + "select": null, + "onDuplicateSet": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "`id`", + "value": "412" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "`val`", + "value": "'Thresh'" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 34 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertOnDuplicateKeyErr.out b/tests/data/parser/parseInsertOnDuplicateKeyErr.out index a76c5cdd0..2118fc486 100644 --- a/tests/data/parser/parseInsertOnDuplicateKeyErr.out +++ b/tests/data/parser/parseInsertOnDuplicateKeyErr.out @@ -1,4 +1,780 @@ -a:4:{s:5:"query";s:96:"INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh') -ON DUPLICATE KEY `id`=412,`val`='Thresh'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:96:"INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh') -ON DUPLICATE KEY `id`=412,`val`='Thresh'";s:3:"len";i:96;s:4:"last";i:96;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"`champs`";s:5:"value";s:6:"champs";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`val`";s:5:"value";s:3:"val";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"412";s:5:"value";i:412;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'Thresh'";s:5:"value";s:6:"Thresh";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DUPLICATE";s:5:"value";s:9:"DUPLICATE";s:7:"keyword";s:9:"DUPLICATE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:69;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`id`";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:73;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:77;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"412";s:5:"value";i:412;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:78;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:81;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"`val`";s:5:"value";s:3:"val";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:82;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:87;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"'Thresh'";s:5:"value";s:6:"Thresh";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:88;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"champs";s:6:"column";N;s:4:"expr";s:8:"`champs`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:2:{i:0;s:2:"id";i:1;s:3:"val";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:1:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:3:"412";i:1;s:8:"'Thresh'";}s:6:"values";a:2:{i:0;s:3:"412";i:1;s:6:"Thresh";}}}s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:25;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:5:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:191;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:191;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:205;i:2;i:0;}i:3;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:219;i:2;i:0;}i:4;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:233;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh')\nON DUPLICATE KEY `id`=412,`val`='Thresh'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `champs` (`id`,`val`) VALUES (412,'Thresh')\nON DUPLICATE KEY `id`=412,`val`='Thresh'", + "len": 96, + "last": 96, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`champs`", + "value": "champs", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`val`", + "value": "val", + "keyword": null, + "type": 8, + "flags": 2, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "412", + "value": 412, + "keyword": null, + "type": 6, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Thresh'", + "value": "Thresh", + "keyword": null, + "type": 7, + "flags": 1, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DUPLICATE", + "value": "DUPLICATE", + "keyword": "DUPLICATE", + "type": 1, + "flags": 1, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`id`", + "value": "id", + "keyword": null, + "type": 8, + "flags": 2, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "412", + "value": 412, + "keyword": null, + "type": 6, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`val`", + "value": "val", + "keyword": null, + "type": 8, + "flags": 2, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Thresh'", + "value": "Thresh", + "keyword": null, + "type": 7, + "flags": 1, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 34 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "champs", + "column": null, + "expr": "`champs`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "val" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "412", + "'Thresh'" + ], + "values": [ + "412", + "Thresh" + ] + } + ], + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 25 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@28" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@28" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@30" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@32" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@34" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertSelect.out b/tests/data/parser/parseInsertSelect.out index cc63fe097..1e2034e5f 100644 --- a/tests/data/parser/parseInsertSelect.out +++ b/tests/data/parser/parseInsertSelect.out @@ -1 +1,822 @@ -a:4:{s:5:"query";s:53:"INSERT INTO `a` (`value`) SELECT `b`.`value` FROM `b`";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:53:"INSERT INTO `a` (`value`) SELECT `b`.`value` FROM `b`";s:3:"len";i:53;s:4:"last";i:53;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:20:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`b`";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:37;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`b`";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:50;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:20;s:3:"idx";i:20;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"b";s:6:"column";s:5:"value";s:4:"expr";s:11:"`b`.`value`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"b";s:6:"column";N;s:4:"expr";s:3:"`b`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:10;s:4:"last";i:18;}s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO `a` (`value`) SELECT `b`.`value` FROM `b`", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `a` (`value`) SELECT `b`.`value` FROM `b`", + "len": 53, + "last": 53, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`b`", + "value": "b", + "keyword": null, + "type": 8, + "flags": 2, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`b`", + "value": "b", + "keyword": null, + "type": 8, + "flags": 2, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 20, + "idx": 20 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "b", + "column": "value", + "expr": "`b`.`value`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "b", + "column": null, + "expr": "`b`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 10, + "last": 18 + }, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertSelectOnDuplicateKey.out b/tests/data/parser/parseInsertSelectOnDuplicateKey.out index 1d5155a06..e98823ce3 100644 --- a/tests/data/parser/parseInsertSelectOnDuplicateKey.out +++ b/tests/data/parser/parseInsertSelectOnDuplicateKey.out @@ -1 +1,898 @@ -a:4:{s:5:"query";s:65:"INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:65:"INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1";s:3:"len";i:65;s:4:"last";i:65;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:28:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"tbl";s:5:"value";s:3:"tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:34;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DUPLICATE";s:5:"value";s:9:"DUPLICATE";s:7:"keyword";s:9:"DUPLICATE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:37;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:51;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:58;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:62;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:64;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:28;s:3:"idx";i:28;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"tbl";s:6:"column";N;s:4:"expr";s:3:"tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"bar";s:6:"column";N;s:4:"expr";s:3:"bar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:6;s:4:"last";i:13;}s:14:"onDuplicateSet";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:3:"baz";s:5:"value";s:1:"1";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:26;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1", + "len": 65, + "last": 65, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl", + "value": "tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DUPLICATE", + "value": "DUPLICATE", + "keyword": "DUPLICATE", + "type": 1, + "flags": 1, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 28, + "idx": 28 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl", + "column": null, + "expr": "tbl", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "bar", + "column": null, + "expr": "bar", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 6, + "last": 13 + }, + "onDuplicateSet": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "baz", + "value": "1" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 26 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertSet.out b/tests/data/parser/parseInsertSet.out index 15a90dc7f..639be49dd 100644 --- a/tests/data/parser/parseInsertSet.out +++ b/tests/data/parser/parseInsertSet.out @@ -1 +1,593 @@ -a:4:{s:5:"query";s:45:"INSERT INTO `a` (`value`) SET `value` = '123'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:45:"INSERT INTO `a` (`value`) SET `value` = '123'";s:3:"len";i:45;s:4:"last";i:45;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'123'";s:5:"value";s:3:"123";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:40;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:7:"`value`";s:5:"value";s:5:"'123'";}}s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO `a` (`value`) SET `value` = '123'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `a` (`value`) SET `value` = '123'", + "len": 45, + "last": 45, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123'", + "value": "123", + "keyword": null, + "type": 7, + "flags": 1, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "`value`", + "value": "'123'" + } + ], + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseInsertSetOnDuplicateKey.out b/tests/data/parser/parseInsertSetOnDuplicateKey.out index e0413ce98..72f4ba85a 100644 --- a/tests/data/parser/parseInsertSetOnDuplicateKey.out +++ b/tests/data/parser/parseInsertSetOnDuplicateKey.out @@ -1 +1,725 @@ -a:4:{s:5:"query";s:86:"INSERT INTO `a` (`value`) SET `value` = '123' ON DUPLICATE KEY UPDATE `value` = '1234'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:86:"INSERT INTO `a` (`value`) SET `value` = '123' ON DUPLICATE KEY UPDATE `value` = '1234'";s:3:"len";i:86;s:4:"last";i:86;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:32:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'123'";s:5:"value";s:3:"123";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:40;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"DUPLICATE";s:5:"value";s:9:"DUPLICATE";s:7:"keyword";s:9:"DUPLICATE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:49;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:70;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:78;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'1234'";s:5:"value";s:4:"1234";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:80;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:32;s:3:"idx";i:32;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:7:"`value`";s:5:"value";s:5:"'123'";}}s:6:"select";N;s:14:"onDuplicateSet";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:7:"`value`";s:5:"value";s:6:"'1234'";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "INSERT INTO `a` (`value`) SET `value` = '123' ON DUPLICATE KEY UPDATE `value` = '1234'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "INSERT INTO `a` (`value`) SET `value` = '123' ON DUPLICATE KEY UPDATE `value` = '1234'", + "len": 86, + "last": 86, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123'", + "value": "123", + "keyword": null, + "type": 7, + "flags": 1, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DUPLICATE", + "value": "DUPLICATE", + "keyword": "DUPLICATE", + "type": 1, + "flags": 1, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'1234'", + "value": "1234", + "keyword": null, + "type": 7, + "flags": 1, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 32, + "idx": 32 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "`value`", + "value": "'123'" + } + ], + "select": null, + "onDuplicateSet": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "`value`", + "value": "'1234'" + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLimitErr1.out b/tests/data/parser/parseLimitErr1.out index 8471e05e8..dd012fec0 100644 --- a/tests/data/parser/parseLimitErr1.out +++ b/tests/data/parser/parseLimitErr1.out @@ -1 +1,746 @@ -a:4:{s:5:"query";s:43:"SELECT * FROM test LIMIT 1 OFFSET OFFSET 2;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"SELECT * FROM test LIMIT 1 OFFSET OFFSET 2;";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:19:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"OFFSET";s:5:"value";s:6:"OFFSET";s:7:"keyword";s:6:"OFFSET";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"OFFSET";s:5:"value";s:6:"OFFSET";s:7:"keyword";s:6:"OFFSET";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:34;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:42;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:19;s:3:"idx";i:19;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:2;s:8:"rowCount";i:1;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:23:"An offset was expected.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM test LIMIT 1 OFFSET OFFSET 2;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM test LIMIT 1 OFFSET OFFSET 2;", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OFFSET", + "value": "OFFSET", + "keyword": "OFFSET", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OFFSET", + "value": "OFFSET", + "keyword": "OFFSET", + "type": 1, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 19, + "idx": 19 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 2, + "rowCount": 1 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An offset was expected.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLimitErr2.out b/tests/data/parser/parseLimitErr2.out index de6cea322..32e7210f1 100644 --- a/tests/data/parser/parseLimitErr2.out +++ b/tests/data/parser/parseLimitErr2.out @@ -1 +1,701 @@ -a:4:{s:5:"query";s:33:"SELECT * FROM test LIMIT 1 OFFSET";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:33:"SELECT * FROM test LIMIT 1 OFFSET";s:3:"len";i:33;s:4:"last";i:33;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"OFFSET";s:5:"value";s:6:"OFFSET";s:7:"keyword";s:6:"OFFSET";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:1;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:12;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:23:"An offset was expected.";i:1;r:93;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM test LIMIT 1 OFFSET", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM test LIMIT 1 OFFSET", + "len": 33, + "last": 33, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OFFSET", + "value": "OFFSET", + "keyword": "OFFSET", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 1 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 12 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An offset was expected.", + { + "@type": "@14" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad1.out b/tests/data/parser/parseLoad1.out index 52f876206..29d5fcb33 100644 --- a/tests/data/parser/parseLoad1.out +++ b/tests/data/parser/parseLoad1.out @@ -1 +1,580 @@ -a:4:{s:5:"query";s:64:"LOAD DATA CONCURRENT INFILE 'employee1.txt' INTO TABLE employee;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:64:"LOAD DATA CONCURRENT INFILE 'employee1.txt' INTO TABLE employee;";s:3:"len";i:64;s:4:"last";i:64;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONCURRENT";s:5:"value";s:10:"CONCURRENT";s:7:"keyword";s:10:"CONCURRENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'employee1.txt'";s:5:"value";s:13:"employee1.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:28;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:44;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:49;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"employee";s:5:"value";s:8:"employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:55;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:63;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'employee1.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"employee1.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"employee";s:6:"column";N;s:4:"expr";s:8:"employee";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";N;s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:10:"CONCURRENT";}}s:5:"first";i:0;s:4:"last";i:12;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA CONCURRENT INFILE 'employee1.txt' INTO TABLE employee;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA CONCURRENT INFILE 'employee1.txt' INTO TABLE employee;", + "len": 64, + "last": 64, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONCURRENT", + "value": "CONCURRENT", + "keyword": "CONCURRENT", + "type": 1, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'employee1.txt'", + "value": "employee1.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "employee", + "value": "employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'employee1.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "employee1.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "employee", + "column": null, + "expr": "employee", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": null, + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CONCURRENT" + } + }, + "first": 0, + "last": 12 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad2.out b/tests/data/parser/parseLoad2.out index 9cfdb39af..df7b6cab5 100644 --- a/tests/data/parser/parseLoad2.out +++ b/tests/data/parser/parseLoad2.out @@ -1 +1,722 @@ -a:4:{s:5:"query";s:89:"LOAD DATA INFILE '/tmp/test.txt' INTO TABLE test FIELDS TERMINATED BY ',' IGNORE 1 LINES;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:89:"LOAD DATA INFILE '/tmp/test.txt' INTO TABLE test FIELDS TERMINATED BY ',' IGNORE 1 LINES;";s:3:"len";i:89;s:4:"last";i:89;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:25:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:38;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"FIELDS";s:5:"value";s:6:"FIELDS";s:7:"keyword";s:6:"FIELDS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:49;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:70;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:74;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:81;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:83;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:88;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:25;s:3:"idx";i:25;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}}}s:14:"fields_keyword";s:6:"FIELDS";s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"replace_ignore";N;s:10:"lines_rows";s:5:"LINES";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:23;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' INTO TABLE test FIELDS TERMINATED BY ',' IGNORE 1 LINES;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' INTO TABLE test FIELDS TERMINATED BY ',' IGNORE 1 LINES;", + "len": 89, + "last": 89, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FIELDS", + "value": "FIELDS", + "keyword": "FIELDS", + "type": 1, + "flags": 1, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 25, + "idx": 25 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + } + } + }, + "fields_keyword": "FIELDS", + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "replace_ignore": null, + "lines_rows": "LINES", + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 23 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad3.out b/tests/data/parser/parseLoad3.out index e7fbdf506..fab0aedd5 100644 --- a/tests/data/parser/parseLoad3.out +++ b/tests/data/parser/parseLoad3.out @@ -1 +1,710 @@ -a:4:{s:5:"query";s:94:"LOAD DATA INFILE 'employee3.txt' INTO TABLE employee FIELDS TERMINATED BY ',' ENCLOSED BY '"';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:94:"LOAD DATA INFILE 'employee3.txt' INTO TABLE employee FIELDS TERMINATED BY ',' ENCLOSED BY '"';";s:3:"len";i:94;s:4:"last";i:94;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'employee3.txt'";s:5:"value";s:13:"employee3.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:38;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"employee";s:5:"value";s:8:"employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"FIELDS";s:5:"value";s:6:"FIELDS";s:7:"keyword";s:6:"FIELDS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:53;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:60;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:74;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:77;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"ENCLOSED BY";s:5:"value";s:11:"ENCLOSED BY";s:7:"keyword";s:11:"ENCLOSED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:78;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"'"'";s:5:"value";s:1:""";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:90;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:93;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'employee3.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"employee3.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"employee";s:6:"column";N;s:4:"expr";s:8:"employee";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}i:3;a:4:{s:4:"name";s:11:"ENCLOSED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:""";s:4:"expr";s:3:"'"'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"'"'";}}}s:14:"fields_keyword";s:6:"FIELDS";s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";N;s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:20;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE 'employee3.txt' INTO TABLE employee FIELDS TERMINATED BY ',' ENCLOSED BY '\"';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE 'employee3.txt' INTO TABLE employee FIELDS TERMINATED BY ',' ENCLOSED BY '\"';", + "len": 94, + "last": 94, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'employee3.txt'", + "value": "employee3.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "employee", + "value": "employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FIELDS", + "value": "FIELDS", + "keyword": "FIELDS", + "type": 1, + "flags": 1, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENCLOSED BY", + "value": "ENCLOSED BY", + "keyword": "ENCLOSED BY", + "type": 1, + "flags": 7, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\"'", + "value": "\"", + "keyword": null, + "type": 7, + "flags": 1, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'employee3.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "employee3.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "employee", + "column": null, + "expr": "employee", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + }, + "3": { + "name": "ENCLOSED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\"", + "expr": "'\"'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\"'" + } + } + }, + "fields_keyword": "FIELDS", + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": null, + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 20 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad4.out b/tests/data/parser/parseLoad4.out index f0ba147c5..88bc026d7 100644 --- a/tests/data/parser/parseLoad4.out +++ b/tests/data/parser/parseLoad4.out @@ -1,22 +1,1049 @@ -a:4:{s:5:"query";s:166:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -CHARACTER SET 'utf8' -COLUMNS TERMINATED BY ',' -LINES TERMINATED BY ';' -IGNORE 1 LINES -(col1, col2) -SET @a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:166:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -CHARACTER SET 'utf8' -COLUMNS TERMINATED BY ',' -LINES TERMINATED BY ';' -IGNORE 1 LINES -(col1, col2) -SET @a = 1;";s:3:"len";i:166;s:4:"last";i:166;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:52:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:70;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLUMNS";s:5:"value";s:7:"COLUMNS";s:7:"keyword";s:7:"COLUMNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:77;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:85;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:99;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:103;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:108;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:109;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"';'";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:123;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:127;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:134;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:136;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:141;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:142;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"col1";s:5:"value";s:4:"col1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:143;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:147;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"col2";s:5:"value";s:4:"col2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:149;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:153;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:155;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:159;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:161;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:162;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:163;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:164;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:165;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:52;s:3:"idx";i:52;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"utf8";s:4:"expr";s:6:"'utf8'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}}}s:14:"fields_keyword";s:7:"COLUMNS";s:13:"lines_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:";";s:4:"expr";s:3:"';'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"';'";}}}s:20:"col_name_or_user_var";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:12:"(col1, col2)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"@a";s:5:"value";s:1:"1";}}s:13:"ignore_number";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";s:5:"LINES";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:49;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nCHARACTER SET 'utf8'\nCOLUMNS TERMINATED BY ','\nLINES TERMINATED BY ';'\nIGNORE 1 LINES\n(col1, col2)\nSET @a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nCHARACTER SET 'utf8'\nCOLUMNS TERMINATED BY ','\nLINES TERMINATED BY ';'\nIGNORE 1 LINES\n(col1, col2)\nSET @a = 1;", + "len": 166, + "last": 166, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMNS", + "value": "COLUMNS", + "keyword": "COLUMNS", + "type": 1, + "flags": 1, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "';'", + "value": ";", + "keyword": null, + "type": 7, + "flags": 1, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "col1", + "value": "col1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "col2", + "value": "col2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 52, + "idx": 52 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "utf8", + "expr": "'utf8'", + "alias": null, + "function": null, + "subquery": null + }, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + } + } + }, + "fields_keyword": "COLUMNS", + "lines_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ";", + "expr": "';'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "';'" + } + } + }, + "col_name_or_user_var": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(col1, col2)", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "@a", + "value": "1" + } + ], + "ignore_number": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "replace_ignore": "IGNORE", + "lines_rows": "LINES", + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 49 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad5.out b/tests/data/parser/parseLoad5.out index 66753ed14..9a7e65f74 100644 --- a/tests/data/parser/parseLoad5.out +++ b/tests/data/parser/parseLoad5.out @@ -1 +1,740 @@ -a:4:{s:5:"query";s:98:"LOAD DATA INFILE '/tmp/test.txt' REPLACE INTO TABLE test COLUMNS TERMINATED BY ',' IGNORE 1 ROWS;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:98:"LOAD DATA INFILE '/tmp/test.txt' REPLACE INTO TABLE test COLUMNS TERMINATED BY ',' IGNORE 1 ROWS;";s:3:"len";i:98;s:4:"last";i:98;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:27:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:34;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLUMNS";s:5:"value";s:7:"COLUMNS";s:7:"keyword";s:7:"COLUMNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:58;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:66;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:80;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:83;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:84;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:91;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"ROWS";s:5:"value";s:4:"ROWS";s:7:"keyword";s:4:"ROWS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:93;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:97;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:27;s:3:"idx";i:27;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}}}s:14:"fields_keyword";s:7:"COLUMNS";s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"replace_ignore";s:7:"REPLACE";s:10:"lines_rows";s:4:"ROWS";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:25;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' REPLACE INTO TABLE test COLUMNS TERMINATED BY ',' IGNORE 1 ROWS;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' REPLACE INTO TABLE test COLUMNS TERMINATED BY ',' IGNORE 1 ROWS;", + "len": 98, + "last": 98, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMNS", + "value": "COLUMNS", + "keyword": "COLUMNS", + "type": 1, + "flags": 1, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ROWS", + "value": "ROWS", + "keyword": "ROWS", + "type": 1, + "flags": 1, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 27, + "idx": 27 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + } + } + }, + "fields_keyword": "COLUMNS", + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "replace_ignore": "REPLACE", + "lines_rows": "ROWS", + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 25 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoad6.out b/tests/data/parser/parseLoad6.out index 810c77739..af5b2969d 100644 --- a/tests/data/parser/parseLoad6.out +++ b/tests/data/parser/parseLoad6.out @@ -1,25 +1,1169 @@ -a:4:{s:5:"query";s:189:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -PARTITION (p0, p1, p2) -CHARACTER SET 'utf8' -COLUMNS TERMINATED BY ',' -LINES TERMINATED BY ';' -IGNORE 1 LINES -(col1, col2) -SET @a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:189:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -PARTITION (p0, p1, p2) -CHARACTER SET 'utf8' -COLUMNS TERMINATED BY ',' -LINES TERMINATED BY ';' -IGNORE 1 LINES -(col1, col2) -SET @a = 1;";s:3:"len";i:189;s:4:"last";i:189;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:64:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:66;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p0";s:5:"value";s:2:"p0";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:67;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p2";s:5:"value";s:2:"p2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:77;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:79;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:93;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLUMNS";s:5:"value";s:7:"COLUMNS";s:7:"keyword";s:7:"COLUMNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:100;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:108;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:121;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:122;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:132;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"';'";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:146;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:149;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:150;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:156;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:157;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:159;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:164;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:165;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"col1";s:5:"value";s:4:"col1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:166;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:170;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:171;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"col2";s:5:"value";s:4:"col2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:172;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:176;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:177;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:178;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:181;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:182;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:184;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:185;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:186;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:187;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:188;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:64;s:3:"idx";i:64;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:3:{i:0;s:2:"p0";i:1;s:2:"p1";i:2;s:2:"p2";}s:6:"values";a:3:{i:0;s:2:"p0";i:1;s:2:"p1";i:2;s:2:"p2";}}s:12:"charset_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"utf8";s:4:"expr";s:6:"'utf8'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}}}s:14:"fields_keyword";s:7:"COLUMNS";s:13:"lines_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:";";s:4:"expr";s:3:"';'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"';'";}}}s:20:"col_name_or_user_var";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:12:"(col1, col2)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"@a";s:5:"value";s:1:"1";}}s:13:"ignore_number";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";s:5:"LINES";s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:61;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nPARTITION (p0, p1, p2)\nCHARACTER SET 'utf8'\nCOLUMNS TERMINATED BY ','\nLINES TERMINATED BY ';'\nIGNORE 1 LINES\n(col1, col2)\nSET @a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nPARTITION (p0, p1, p2)\nCHARACTER SET 'utf8'\nCOLUMNS TERMINATED BY ','\nLINES TERMINATED BY ';'\nIGNORE 1 LINES\n(col1, col2)\nSET @a = 1;", + "len": 189, + "last": 189, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p0", + "value": "p0", + "keyword": null, + "type": 0, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p2", + "value": "p2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMNS", + "value": "COLUMNS", + "keyword": "COLUMNS", + "type": 1, + "flags": 1, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "';'", + "value": ";", + "keyword": null, + "type": 7, + "flags": 1, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "col1", + "value": "col1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "col2", + "value": "col2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 184 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 185 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 186 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 188 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 64, + "idx": 64 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "p0", + "p1", + "p2" + ], + "values": [ + "p0", + "p1", + "p2" + ] + }, + "charset_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "utf8", + "expr": "'utf8'", + "alias": null, + "function": null, + "subquery": null + }, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + } + } + }, + "fields_keyword": "COLUMNS", + "lines_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ";", + "expr": "';'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "';'" + } + } + }, + "col_name_or_user_var": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(col1, col2)", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "@a", + "value": "1" + } + ], + "ignore_number": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "replace_ignore": "IGNORE", + "lines_rows": "LINES", + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 61 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr1.out b/tests/data/parser/parseLoadErr1.out index 81fda8eed..0603b4809 100644 --- a/tests/data/parser/parseLoadErr1.out +++ b/tests/data/parser/parseLoadErr1.out @@ -1 +1,550 @@ -a:4:{s:5:"query";s:62:"LOAD DATA CONCURRENT FROM 'employee1.txt' INTO TABLE employee;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:62:"LOAD DATA CONCURRENT FROM 'employee1.txt' INTO TABLE employee;";s:3:"len";i:62;s:4:"last";i:62;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONCURRENT";s:5:"value";s:10:"CONCURRENT";s:7:"keyword";s:10:"CONCURRENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'employee1.txt'";s:5:"value";s:13:"employee1.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"employee";s:5:"value";s:8:"employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:61;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";N;s:5:"table";N;s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";N;s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:10:"CONCURRENT";}}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA CONCURRENT FROM 'employee1.txt' INTO TABLE employee;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA CONCURRENT FROM 'employee1.txt' INTO TABLE employee;", + "len": 62, + "last": 62, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONCURRENT", + "value": "CONCURRENT", + "keyword": "CONCURRENT", + "type": 1, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'employee1.txt'", + "value": "employee1.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "employee", + "value": "employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": null, + "table": null, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": null, + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CONCURRENT" + } + }, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr2.out b/tests/data/parser/parseLoadErr2.out index 5aa92a2ea..ab7570dec 100644 --- a/tests/data/parser/parseLoadErr2.out +++ b/tests/data/parser/parseLoadErr2.out @@ -1 +1,564 @@ -a:4:{s:5:"query";s:61:"LOAD DATA CONCURRENT ABC 'employee1.txt' INTO TABLE employee;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:61:"LOAD DATA CONCURRENT ABC 'employee1.txt' INTO TABLE employee;";s:3:"len";i:61;s:4:"last";i:61;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CONCURRENT";s:5:"value";s:10:"CONCURRENT";s:7:"keyword";s:10:"CONCURRENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ABC";s:5:"value";s:3:"ABC";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'employee1.txt'";s:5:"value";s:13:"employee1.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:25;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:41;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:46;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"employee";s:5:"value";s:8:"employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:52;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:60;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";N;s:5:"table";N;s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";N;s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:10:"CONCURRENT";}}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:37;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:51;i:2;i:0;}i:3;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA CONCURRENT ABC 'employee1.txt' INTO TABLE employee;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA CONCURRENT ABC 'employee1.txt' INTO TABLE employee;", + "len": 61, + "last": 61, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CONCURRENT", + "value": "CONCURRENT", + "keyword": "CONCURRENT", + "type": 1, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ABC", + "value": "ABC", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'employee1.txt'", + "value": "employee1.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "employee", + "value": "employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": null, + "table": null, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": null, + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "CONCURRENT" + } + }, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@8" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr3.out b/tests/data/parser/parseLoadErr3.out index 97b5ed749..658a270aa 100644 --- a/tests/data/parser/parseLoadErr3.out +++ b/tests/data/parser/parseLoadErr3.out @@ -1,7 +1,658 @@ -a:4:{s:5:"query";s:68:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -DATA @a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:68:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -DATA @a = 1;";s:3:"len";i:68;s:4:"last";i:68;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DATA";s:5:"value";s:4:"DATA";s:7:"keyword";s:4:"DATA";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:61;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:66;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:67;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nDATA @a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nDATA @a = 1;", + "len": 68, + "last": 68, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATA", + "value": "DATA", + "keyword": "DATA", + "type": 1, + "flags": 1, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": "IGNORE", + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized statement type.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr4.out b/tests/data/parser/parseLoadErr4.out index 39d926295..0fb66c670 100644 --- a/tests/data/parser/parseLoadErr4.out +++ b/tests/data/parser/parseLoadErr4.out @@ -1,7 +1,632 @@ -a:4:{s:5:"query";s:62:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO test -DATA @a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:62:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO test -DATA @a = 1;";s:3:"len";i:62;s:4:"last";i:62;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DATA";s:5:"value";s:4:"DATA";s:7:"keyword";s:4:"DATA";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:50;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:55;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:58;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:60;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:61;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";N;s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:79;i:2;i:0;}i:2;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:93;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO test\nDATA @a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO test\nDATA @a = 1;", + "len": 62, + "last": 62, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATA", + "value": "DATA", + "keyword": "DATA", + "type": 1, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": null, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": "IGNORE", + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@14" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr5.out b/tests/data/parser/parseLoadErr5.out index 178b38543..bb1ad613c 100644 --- a/tests/data/parser/parseLoadErr5.out +++ b/tests/data/parser/parseLoadErr5.out @@ -1,7 +1,654 @@ -a:4:{s:5:"query";s:63:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -@a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:63:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -@a = 1;";s:3:"len";i:63;s:4:"last";i:63;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:59;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:61;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:62;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:107;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:135;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\n@a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\n@a = 1;", + "len": 63, + "last": 63, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": "IGNORE", + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@16" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@20" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLoadErr6.out b/tests/data/parser/parseLoadErr6.out index 97b5ed749..658a270aa 100644 --- a/tests/data/parser/parseLoadErr6.out +++ b/tests/data/parser/parseLoadErr6.out @@ -1,7 +1,658 @@ -a:4:{s:5:"query";s:68:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -DATA @a = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:68:"LOAD DATA INFILE '/tmp/test.txt' IGNORE -INTO TABLE test -DATA @a = 1;";s:3:"len";i:68;s:4:"last";i:68;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LOAD DATA";s:5:"value";s:9:"LOAD DATA";s:7:"keyword";s:9:"LOAD DATA";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INFILE";s:5:"value";s:6:"INFILE";s:7:"keyword";s:6:"INFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'/tmp/test.txt'";s:5:"value";s:13:"/tmp/test.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DATA";s:5:"value";s:4:"DATA";s:7:"keyword";s:4:"DATA";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:56;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:61;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:66;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:67;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LoadStatement":15:{s:9:"file_name";O:42:"PhpMyAdmin\SqlParser\Components\Expression":8:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"'/tmp/test.txt'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;s:4:"file";s:13:"/tmp/test.txt";}s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:9:"partition";N;s:12:"charset_name";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;s:20:"col_name_or_user_var";N;s:3:"set";N;s:13:"ignore_number";N;s:14:"replace_ignore";s:6:"IGNORE";s:10:"lines_rows";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nDATA @a = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOAD DATA INFILE '\/tmp\/test.txt' IGNORE\nINTO TABLE test\nDATA @a = 1;", + "len": 68, + "last": 68, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOAD DATA", + "value": "LOAD DATA", + "keyword": "LOAD DATA", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INFILE", + "value": "INFILE", + "keyword": "INFILE", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/test.txt'", + "value": "\/tmp\/test.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DATA", + "value": "DATA", + "keyword": "DATA", + "type": 1, + "flags": 1, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@a", + "value": "a", + "keyword": null, + "type": 8, + "flags": 1, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "CONCURRENT": 1, + "LOCAL": 2 + }, + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "file_name": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "'\/tmp\/test.txt'", + "alias": null, + "function": null, + "subquery": null, + "file": "\/tmp\/test.txt" + }, + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + }, + "partition": null, + "charset_name": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null, + "col_name_or_user_var": null, + "set": null, + "ignore_number": null, + "replace_ignore": "IGNORE", + "lines_rows": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized statement type.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock1.out b/tests/data/parser/parseLock1.out index 678bd43bb..d85737de7 100644 --- a/tests/data/parser/parseLock1.out +++ b/tests/data/parser/parseLock1.out @@ -1 +1,519 @@ -a:4:{s:5:"query";s:43:"LOCK TABLES table1 AS `t1` READ LOCAL;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"LOCK TABLES table1 AS `t1` READ LOCAL;";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:42;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:10:"READ LOCAL";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` READ LOCAL;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` READ LOCAL;", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "READ LOCAL" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock2.out b/tests/data/parser/parseLock2.out index 75bcba2a4..bf118e96d 100644 --- a/tests/data/parser/parseLock2.out +++ b/tests/data/parser/parseLock2.out @@ -1 +1,501 @@ -a:4:{s:5:"query";s:32:"LOCK TABLES table1 AS `t1` READ;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:32:"LOCK TABLES table1 AS `t1` READ;";s:3:"len";i:32;s:4:"last";i:32;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:4:"READ";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` READ;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` READ;", + "len": 32, + "last": 32, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "READ" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock3.out b/tests/data/parser/parseLock3.out index 1ced5abbd..1252ec10a 100644 --- a/tests/data/parser/parseLock3.out +++ b/tests/data/parser/parseLock3.out @@ -1 +1,519 @@ -a:4:{s:5:"query";s:46:"LOCK TABLES table1 AS `t1` LOW_PRIORITY WRITE;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:46:"LOCK TABLES table1 AS `t1` LOW_PRIORITY WRITE;";s:3:"len";i:46;s:4:"last";i:46;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WRITE";s:5:"value";s:5:"WRITE";s:7:"keyword";s:5:"WRITE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:40;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:18:"LOW_PRIORITY WRITE";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` LOW_PRIORITY WRITE;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` LOW_PRIORITY WRITE;", + "len": 46, + "last": 46, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WRITE", + "value": "WRITE", + "keyword": "WRITE", + "type": 1, + "flags": 3, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "LOW_PRIORITY WRITE" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock4.out b/tests/data/parser/parseLock4.out index 0a57e2119..768efa88c 100644 --- a/tests/data/parser/parseLock4.out +++ b/tests/data/parser/parseLock4.out @@ -1 +1,501 @@ -a:4:{s:5:"query";s:33:"LOCK TABLES table1 AS `t1` WRITE;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:33:"LOCK TABLES table1 AS `t1` WRITE;";s:3:"len";i:33;s:4:"last";i:33;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WRITE";s:5:"value";s:5:"WRITE";s:7:"keyword";s:5:"WRITE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:5:"WRITE";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` WRITE;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` WRITE;", + "len": 33, + "last": 33, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WRITE", + "value": "WRITE", + "keyword": "WRITE", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "WRITE" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock5.out b/tests/data/parser/parseLock5.out index ad148cfb5..5f57a2f37 100644 --- a/tests/data/parser/parseLock5.out +++ b/tests/data/parser/parseLock5.out @@ -1 +1,627 @@ -a:4:{s:5:"query";s:60:"LOCK TABLES table1 AS `t1` READ LOCAL, table2 AS `t2` WRITE;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:60:"LOCK TABLES table1 AS `t1` READ LOCAL, table2 AS `t2` WRITE;";s:3:"len";i:60;s:4:"last";i:60;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:49;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WRITE";s:5:"value";s:5:"WRITE";s:7:"keyword";s:5:"WRITE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:2:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:10:"READ LOCAL";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:5:"WRITE";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:22;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` READ LOCAL, table2 AS `t2` WRITE;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` READ LOCAL, table2 AS `t2` WRITE;", + "len": 60, + "last": 60, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WRITE", + "value": "WRITE", + "keyword": "WRITE", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "READ LOCAL" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + }, + "type": "WRITE" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 22 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLock6.out b/tests/data/parser/parseLock6.out index 3b3d45b2e..a0c488d59 100644 --- a/tests/data/parser/parseLock6.out +++ b/tests/data/parser/parseLock6.out @@ -1 +1,591 @@ -a:4:{s:5:"query";s:52:"LOCK TABLES table1 READ LOCAL, table2 AS `t2` WRITE;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:52:"LOCK TABLES table1 READ LOCAL, table2 AS `t2` WRITE;";s:3:"len";i:52;s:4:"last";i:52;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:20:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:29;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:38;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t2`";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WRITE";s:5:"value";s:5:"WRITE";s:7:"keyword";s:5:"WRITE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:51;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:20;s:3:"idx";i:20;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:2:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:10:"READ LOCAL";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";s:2:"t2";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:5:"WRITE";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 READ LOCAL, table2 AS `t2` WRITE;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 READ LOCAL, table2 AS `t2` WRITE;", + "len": 52, + "last": 52, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t2`", + "value": "t2", + "keyword": null, + "type": 8, + "flags": 2, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WRITE", + "value": "WRITE", + "keyword": "WRITE", + "type": 1, + "flags": 3, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 20, + "idx": 20 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + "type": "READ LOCAL" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": "t2", + "function": null, + "subquery": null + }, + "type": "WRITE" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr1.out b/tests/data/parser/parseLockErr1.out index 5d6ee1765..658dbe02f 100644 --- a/tests/data/parser/parseLockErr1.out +++ b/tests/data/parser/parseLockErr1.out @@ -1 +1,446 @@ -a:4:{s:5:"query";s:18:"LOCK TABLES table1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"LOCK TABLES table1";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";N;}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:5;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:34:"Unexpected end of LOCK expression.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + "type": null + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 5 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected end of LOCK expression.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr10.out b/tests/data/parser/parseLockErr10.out index 215a872ff..04fa0bedf 100644 --- a/tests/data/parser/parseLockErr10.out +++ b/tests/data/parser/parseLockErr10.out @@ -1 +1,536 @@ -a:4:{s:5:"query";s:51:"LOCK TABLES table1 AS table1 LOW_PRIORITY WRITE abc";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:51:"LOCK TABLES table1 AS table1 LOW_PRIORITY WRITE abc";s:3:"len";i:51;s:4:"last";i:51;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WRITE";s:5:"value";s:5:"WRITE";s:7:"keyword";s:5:"WRITE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"abc";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:16;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:6:"table1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:18:"LOW_PRIORITY WRITE";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS table1 LOW_PRIORITY WRITE abc", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS table1 LOW_PRIORITY WRITE abc", + "len": 51, + "last": 51, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WRITE", + "value": "WRITE", + "keyword": "WRITE", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abc", + "value": "abc", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 16 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "table1", + "function": null, + "subquery": null + }, + "type": "LOW_PRIORITY WRITE" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr2.out b/tests/data/parser/parseLockErr2.out index f58f6736b..850a3f6a5 100644 --- a/tests/data/parser/parseLockErr2.out +++ b/tests/data/parser/parseLockErr2.out @@ -1 +1,505 @@ -a:4:{s:5:"query";s:32:"LOCK TABLES table1 AS `t1` LOCAL";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:32:"LOCK TABLES table1 AS `t1` LOCAL";s:3:"len";i:32;s:4:"last";i:32;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:12:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`t1`";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:12;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:0:"";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected end of Lock expression.";i:1;N;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS `t1` LOCAL", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS `t1` LOCAL", + "len": 32, + "last": 32, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`t1`", + "value": "t1", + "keyword": null, + "type": 8, + "flags": 2, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 12, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "t1", + "function": null, + "subquery": null + }, + "type": "" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected end of Lock expression.", + null, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr3.out b/tests/data/parser/parseLockErr3.out index 4b5131c9e..8f6c09ea3 100644 --- a/tests/data/parser/parseLockErr3.out +++ b/tests/data/parser/parseLockErr3.out @@ -1,4 +1,504 @@ -a:4:{s:5:"query";s:49:"-- TABLES misspelled -LOCK TABLE table1 AS t1 READ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:49:"-- TABLES misspelled -LOCK TABLE table1 AS t1 READ";s:3:"len";i:49;s:4:"last";i:49;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"-- TABLES misspelled";s:5:"value";s:20:"-- TABLES misspelled";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:39;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:42;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:0:{}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:51;i:2;i:0;}i:2;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- TABLES misspelled\nLOCK TABLE table1 AS t1 READ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- TABLES misspelled\nLOCK TABLE table1 AS t1 READ", + "len": 49, + "last": 49, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- TABLES misspelled", + "value": "-- TABLES misspelled", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@8" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr4.out b/tests/data/parser/parseLockErr4.out index ab57794ed..803c70d35 100644 --- a/tests/data/parser/parseLockErr4.out +++ b/tests/data/parser/parseLockErr4.out @@ -1,4 +1,461 @@ -a:4:{s:5:"query";s:48:"-- missing TABLES keyword -LOCK table1 READ LOCAL";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:48:"-- missing TABLES keyword -LOCK table1 READ LOCAL";s:3:"len";i:48;s:4:"last";i:48;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:25:"-- missing TABLES keyword";s:5:"value";s:25:"-- missing TABLES keyword";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:38;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:43;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:0:{}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:28:"Unrecognized statement type.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- missing TABLES keyword\nLOCK table1 READ LOCAL", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- missing TABLES keyword\nLOCK table1 READ LOCAL", + "len": 48, + "last": 48, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- missing TABLES keyword", + "value": "-- missing TABLES keyword", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@6" + }, + 0 + ], + [ + "Unrecognized statement type.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr5.out b/tests/data/parser/parseLockErr5.out index b89a749e0..bb90f0afd 100644 --- a/tests/data/parser/parseLockErr5.out +++ b/tests/data/parser/parseLockErr5.out @@ -1,4 +1,509 @@ -a:4:{s:5:"query";s:50:"-- extraneous comma -LOCK TABLES table1 READ LOCAL,";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:50:"-- extraneous comma -LOCK TABLES table1 READ LOCAL,";s:3:"len";i:50;s:4:"last";i:50;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:19:"-- extraneous comma";s:5:"value";s:19:"-- extraneous comma";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:25;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:39;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LOCAL";s:5:"value";s:5:"LOCAL";s:7:"keyword";s:5:"LOCAL";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:10:"READ LOCAL";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:12;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:33:"Unexpected end of LOCK statement.";i:1;r:86;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- extraneous comma\nLOCK TABLES table1 READ LOCAL,", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- extraneous comma\nLOCK TABLES table1 READ LOCAL,", + "len": 50, + "last": 50, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- extraneous comma", + "value": "-- extraneous comma", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCAL", + "value": "LOCAL", + "keyword": "LOCAL", + "type": 1, + "flags": 1, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + "type": "READ LOCAL" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 12 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected end of LOCK statement.", + { + "@type": "@13" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr6.out b/tests/data/parser/parseLockErr6.out index 941147781..ff148bce9 100644 --- a/tests/data/parser/parseLockErr6.out +++ b/tests/data/parser/parseLockErr6.out @@ -1,4 +1,464 @@ -a:4:{s:5:"query";s:39:"-- missing lock type -LOCK TABLES table1";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:39:"-- missing lock type -LOCK TABLES table1";s:3:"len";i:39;s:4:"last";i:39;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:20:"-- missing lock type";s:5:"value";s:20:"-- missing lock type";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:26;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:33;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:8;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";N;}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:34:"Unexpected end of LOCK expression.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- missing lock type\nLOCK TABLES table1", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- missing lock type\nLOCK TABLES table1", + "len": 39, + "last": 39, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- missing lock type", + "value": "-- missing lock type", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 8 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + }, + "type": null + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected end of LOCK expression.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr7.out b/tests/data/parser/parseLockErr7.out index 4febe8a18..613ec49ba 100644 --- a/tests/data/parser/parseLockErr7.out +++ b/tests/data/parser/parseLockErr7.out @@ -1 +1,512 @@ -a:4:{s:5:"query";s:40:"LOCK TABLES table1 AS table1 non_keyword";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:40:"LOCK TABLES table1 AS table1 non_keyword";s:3:"len";i:40;s:4:"last";i:40;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:12:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"non_keyword";s:5:"value";s:11:"non_keyword";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:12;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:6:"table1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:0:"";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:30:"An alias was previously found.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:79;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected end of Lock expression.";i:1;N;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS table1 non_keyword", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS table1 non_keyword", + "len": 40, + "last": 40, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "non_keyword", + "value": "non_keyword", + "keyword": null, + "type": 0, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 12, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "table1", + "function": null, + "subquery": null + }, + "type": "" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was previously found.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected end of Lock expression.", + null, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr8.out b/tests/data/parser/parseLockErr8.out index 692559e42..a56ea4bc9 100644 --- a/tests/data/parser/parseLockErr8.out +++ b/tests/data/parser/parseLockErr8.out @@ -1 +1,518 @@ -a:4:{s:5:"query";s:48:"LOCK TABLES table1 AS table1 READ AUTO_INCREMENT";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:48:"LOCK TABLES table1 AS table1 READ AUTO_INCREMENT";s:3:"len";i:48;s:4:"last";i:48;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"AUTO_INCREMENT";s:5:"value";s:14:"AUTO_INCREMENT";s:7:"keyword";s:14:"AUTO_INCREMENT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:6:"table1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:4:"READ";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:93;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS table1 READ AUTO_INCREMENT", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS table1 READ AUTO_INCREMENT", + "len": 48, + "last": 48, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AUTO_INCREMENT", + "value": "AUTO_INCREMENT", + "keyword": "AUTO_INCREMENT", + "type": 1, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "table1", + "function": null, + "subquery": null + }, + "type": "READ" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@14" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseLockErr9.out b/tests/data/parser/parseLockErr9.out index 24a8a13fb..863403862 100644 --- a/tests/data/parser/parseLockErr9.out +++ b/tests/data/parser/parseLockErr9.out @@ -1 +1,525 @@ -a:4:{s:5:"query";s:46:"LOCK TABLES table1 AS table1 LOW_PRIORITY READ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:46:"LOCK TABLES table1 AS table1 LOW_PRIORITY READ";s:3:"len";i:46;s:4:"last";i:46;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOCK";s:5:"value";s:4:"LOCK";s:7:"keyword";s:4:"LOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:4;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:5;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"READ";s:5:"value";s:4:"READ";s:7:"keyword";s:4:"READ";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\LockExpression":2:{s:5:"table";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";s:6:"table1";s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:12:"LOW_PRIORITY";}}s:6:"isLock";b:1;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:93;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected end of Lock expression.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "LOCK TABLES table1 AS table1 LOW_PRIORITY READ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "LOCK TABLES table1 AS table1 LOW_PRIORITY READ", + "len": 46, + "last": 46, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK", + "value": "LOCK", + "keyword": "LOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "READ", + "value": "READ", + "keyword": "READ", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\LockExpression", + "table": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": "table1", + "function": null, + "subquery": null + }, + "type": "LOW_PRIORITY" + } + ], + "isLock": true, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 13 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@14" + }, + 0 + ], + [ + "Unexpected end of Lock expression.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurge.out b/tests/data/parser/parsePurge.out index b21609c93..2bc3771dc 100644 --- a/tests/data/parser/parsePurge.out +++ b/tests/data/parser/parsePurge.out @@ -1 +1,478 @@ -a:4:{s:5:"query";s:37:"PURGE BINARY LOGS TO 'mysql-bin.010';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:37:"PURGE BINARY LOGS TO 'mysql-bin.010';";s:3:"len";i:37;s:4:"last";i:37;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'mysql-bin.010'";s:5:"value";s:13:"mysql-bin.010";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"BINARY";s:10:"end_option";s:2:"TO";s:8:"end_expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:13:"mysql-bin.010";s:4:"expr";s:15:"'mysql-bin.010'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "PURGE BINARY LOGS TO 'mysql-bin.010';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE BINARY LOGS TO 'mysql-bin.010';", + "len": 37, + "last": 37, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'mysql-bin.010'", + "value": "mysql-bin.010", + "keyword": null, + "type": 7, + "flags": 1, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "BINARY", + "end_option": "TO", + "end_expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "mysql-bin.010", + "expr": "'mysql-bin.010'", + "alias": null, + "function": null, + "subquery": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurge2.out b/tests/data/parser/parsePurge2.out index 7175a1ec1..3a76fa0fb 100644 --- a/tests/data/parser/parsePurge2.out +++ b/tests/data/parser/parsePurge2.out @@ -1 +1,478 @@ -a:4:{s:5:"query";s:47:"PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:47:"PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';";s:3:"len";i:47;s:4:"last";i:47;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BEFORE";s:5:"value";s:6:"BEFORE";s:7:"keyword";s:6:"BEFORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:21:"'2008-04-02 22:46:26'";s:5:"value";s:19:"2008-04-02 22:46:26";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:46;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"BINARY";s:10:"end_option";s:6:"BEFORE";s:8:"end_expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:19:"2008-04-02 22:46:26";s:4:"expr";s:21:"'2008-04-02 22:46:26'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';", + "len": 47, + "last": 47, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEFORE", + "value": "BEFORE", + "keyword": "BEFORE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'2008-04-02 22:46:26'", + "value": "2008-04-02 22:46:26", + "keyword": null, + "type": 7, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "BINARY", + "end_option": "BEFORE", + "end_expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "2008-04-02 22:46:26", + "expr": "'2008-04-02 22:46:26'", + "alias": null, + "function": null, + "subquery": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurge3.out b/tests/data/parser/parsePurge3.out index d3543e3a3..46bd6b8a0 100644 --- a/tests/data/parser/parsePurge3.out +++ b/tests/data/parser/parsePurge3.out @@ -1 +1,478 @@ -a:4:{s:5:"query";s:47:"PURGE MASTER LOGS BEFORE '2008-04-02 22:46:26';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:47:"PURGE MASTER LOGS BEFORE '2008-04-02 22:46:26';";s:3:"len";i:47;s:4:"last";i:47;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MASTER";s:5:"value";s:6:"MASTER";s:7:"keyword";s:6:"MASTER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BEFORE";s:5:"value";s:6:"BEFORE";s:7:"keyword";s:6:"BEFORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:21:"'2008-04-02 22:46:26'";s:5:"value";s:19:"2008-04-02 22:46:26";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:46;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"MASTER";s:10:"end_option";s:6:"BEFORE";s:8:"end_expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:19:"2008-04-02 22:46:26";s:4:"expr";s:21:"'2008-04-02 22:46:26'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "PURGE MASTER LOGS BEFORE '2008-04-02 22:46:26';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE MASTER LOGS BEFORE '2008-04-02 22:46:26';", + "len": 47, + "last": 47, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MASTER", + "value": "MASTER", + "keyword": "MASTER", + "type": 1, + "flags": 1, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BEFORE", + "value": "BEFORE", + "keyword": "BEFORE", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'2008-04-02 22:46:26'", + "value": "2008-04-02 22:46:26", + "keyword": null, + "type": 7, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "MASTER", + "end_option": "BEFORE", + "end_expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "2008-04-02 22:46:26", + "expr": "'2008-04-02 22:46:26'", + "alias": null, + "function": null, + "subquery": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurge4.out b/tests/data/parser/parsePurge4.out index 857de005a..b6b1dc41a 100644 --- a/tests/data/parser/parsePurge4.out +++ b/tests/data/parser/parsePurge4.out @@ -1 +1,478 @@ -a:4:{s:5:"query";s:37:"PURGE MASTER LOGS TO 'mysql-bin.010';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:37:"PURGE MASTER LOGS TO 'mysql-bin.010';";s:3:"len";i:37;s:4:"last";i:37;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"MASTER";s:5:"value";s:6:"MASTER";s:7:"keyword";s:6:"MASTER";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'mysql-bin.010'";s:5:"value";s:13:"mysql-bin.010";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"MASTER";s:10:"end_option";s:2:"TO";s:8:"end_expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:13:"mysql-bin.010";s:4:"expr";s:15:"'mysql-bin.010'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "PURGE MASTER LOGS TO 'mysql-bin.010';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE MASTER LOGS TO 'mysql-bin.010';", + "len": 37, + "last": 37, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MASTER", + "value": "MASTER", + "keyword": "MASTER", + "type": 1, + "flags": 1, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'mysql-bin.010'", + "value": "mysql-bin.010", + "keyword": null, + "type": 7, + "flags": 1, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "MASTER", + "end_option": "TO", + "end_expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "mysql-bin.010", + "expr": "'mysql-bin.010'", + "alias": null, + "function": null, + "subquery": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurgeErr.out b/tests/data/parser/parsePurgeErr.out index 0175550f1..a12ea4dee 100644 --- a/tests/data/parser/parsePurgeErr.out +++ b/tests/data/parser/parsePurgeErr.out @@ -1 +1,467 @@ -a:4:{s:5:"query";s:30:"PURGE LOGS TO 'mysql-bin.010';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:30:"PURGE LOGS TO 'mysql-bin.010';";s:3:"len";i:30;s:4:"last";i:30;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"'mysql-bin.010'";s:5:"value";s:13:"mysql-bin.010";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";N;s:10:"end_option";N;s:8:"end_expr";N;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:18:"Unexpected keyword";i:1;r:23;i:2;i:0;}i:1;a:3:{i:0;s:18:"Unexpected keyword";i:1;r:37;i:2;i:0;}i:2;a:3:{i:0;s:17:"Unexpected token.";i:1;r:51;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "PURGE LOGS TO 'mysql-bin.010';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE LOGS TO 'mysql-bin.010';", + "len": 30, + "last": 30, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'mysql-bin.010'", + "value": "mysql-bin.010", + "keyword": null, + "type": 7, + "flags": 1, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": null, + "end_option": null, + "end_expr": null, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword", + { + "@type": "@4" + }, + 0 + ], + [ + "Unexpected keyword", + { + "@type": "@6" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@8" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurgeErr2.out b/tests/data/parser/parsePurgeErr2.out index 56fa5420d..ec2e01bfa 100644 --- a/tests/data/parser/parsePurgeErr2.out +++ b/tests/data/parser/parsePurgeErr2.out @@ -1 +1,453 @@ -a:4:{s:5:"query";s:23:"PURGE BINARY LOGS INTO;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:23:"PURGE BINARY LOGS INTO;";s:3:"len";i:23;s:4:"last";i:23;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"BINARY";s:10:"end_option";N;s:8:"end_expr";N;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:18:"Unexpected keyword";i:1;r:51;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "PURGE BINARY LOGS INTO;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE BINARY LOGS INTO;", + "len": 23, + "last": 23, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "BINARY", + "end_option": null, + "end_expr": null, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword", + { + "@type": "@8" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parsePurgeErr3.out b/tests/data/parser/parsePurgeErr3.out index 029890789..749b2e641 100644 --- a/tests/data/parser/parsePurgeErr3.out +++ b/tests/data/parser/parsePurgeErr3.out @@ -1 +1,511 @@ -a:4:{s:5:"query";s:38:"PURGE BINARY LOGS TO 'mysql.bin' INTO;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:38:"PURGE BINARY LOGS TO 'mysql.bin' INTO;";s:3:"len";i:38;s:4:"last";i:38;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"PURGE";s:5:"value";s:5:"PURGE";s:7:"keyword";s:5:"PURGE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"LOGS";s:5:"value";s:4:"LOGS";s:7:"keyword";s:4:"LOGS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"'mysql.bin'";s:5:"value";s:9:"mysql.bin";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:37;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Statements\PurgeStatement":6:{s:8:"log_type";s:6:"BINARY";s:10:"end_option";s:2:"TO";s:8:"end_expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:9:"mysql.bin";s:4:"expr";s:11:"'mysql.bin'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:11;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "PURGE BINARY LOGS TO 'mysql.bin' INTO;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "PURGE BINARY LOGS TO 'mysql.bin' INTO;", + "len": 38, + "last": 38, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PURGE", + "value": "PURGE", + "keyword": "PURGE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOGS", + "value": "LOGS", + "keyword": "LOGS", + "type": 1, + "flags": 1, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'mysql.bin'", + "value": "mysql.bin", + "keyword": null, + "type": 7, + "flags": 1, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "log_type": "BINARY", + "end_option": "TO", + "end_expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "mysql.bin", + "expr": "'mysql.bin'", + "alias": null, + "function": null, + "subquery": null + }, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 11 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRename.out b/tests/data/parser/parseRename.out index 95cb72a6b..3097c8f31 100644 --- a/tests/data/parser/parseRename.out +++ b/tests/data/parser/parseRename.out @@ -1 +1,495 @@ -a:4:{s:5:"query";s:23:"RENAME TABLE foo TO bar";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:23:"RENAME TABLE foo TO bar";s:3:"len";i:23;s:4:"last";i:23;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"bar";s:6:"column";N;s:4:"expr";s:3:"bar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "RENAME TABLE foo TO bar", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE foo TO bar", + "len": 23, + "last": 23, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + }, + "new": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "bar", + "column": null, + "expr": "bar", + "alias": null, + "function": null, + "subquery": null + } + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRename2.out b/tests/data/parser/parseRename2.out index 27aec11c1..b32ab30ea 100644 --- a/tests/data/parser/parseRename2.out +++ b/tests/data/parser/parseRename2.out @@ -1 +1,616 @@ -a:4:{s:5:"query";s:36:"RENAME TABLE foo TO bar, baz TO qux;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:36:"RENAME TABLE foo TO bar, baz TO qux;";s:3:"len";i:36;s:4:"last";i:36;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:29;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"qux";s:5:"value";s:3:"qux";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:35;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"bar";s:6:"column";N;s:4:"expr";s:3:"bar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}i:1;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"baz";s:6:"column";N;s:4:"expr";s:3:"baz";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"qux";s:6:"column";N;s:4:"expr";s:3:"qux";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "RENAME TABLE foo TO bar, baz TO qux;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE foo TO bar, baz TO qux;", + "len": 36, + "last": 36, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "qux", + "value": "qux", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + }, + "new": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "bar", + "column": null, + "expr": "bar", + "alias": null, + "function": null, + "subquery": null + } + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "baz", + "column": null, + "expr": "baz", + "alias": null, + "function": null, + "subquery": null + }, + "new": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "qux", + "column": null, + "expr": "qux", + "alias": null, + "function": null, + "subquery": null + } + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRenameErr1.out b/tests/data/parser/parseRenameErr1.out index 484ce5ba9..ebf5356de 100644 --- a/tests/data/parser/parseRenameErr1.out +++ b/tests/data/parser/parseRenameErr1.out @@ -1 +1,481 @@ -a:4:{s:5:"query";s:20:"RENAME TABLE a TO TO";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:20:"RENAME TABLE a TO TO";s:3:"len";i:20;s:4:"last";i:20;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";N;}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:39:"The new name of the table was expected.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "RENAME TABLE a TO TO", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE a TO TO", + "len": 20, + "last": 20, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + "new": null + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "The new name of the table was expected.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRenameErr2.out b/tests/data/parser/parseRenameErr2.out index 872acb4bd..33cb2d1e6 100644 --- a/tests/data/parser/parseRenameErr2.out +++ b/tests/data/parser/parseRenameErr2.out @@ -1 +1,424 @@ -a:4:{s:5:"query";s:18:"RENAME TABLE TABLE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"RENAME TABLE TABLE";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";a:0:{}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:39:"The old name of the table was expected.";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:32:"A rename operation was expected.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "RENAME TABLE TABLE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE TABLE", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "The old name of the table was expected.", + { + "@type": "@6" + }, + 0 + ], + [ + "A rename operation was expected.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRenameErr3.out b/tests/data/parser/parseRenameErr3.out index b17789672..44db62f2e 100644 --- a/tests/data/parser/parseRenameErr3.out +++ b/tests/data/parser/parseRenameErr3.out @@ -1 +1,478 @@ -a:4:{s:5:"query";s:19:"RENAME TABLE a FROM";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:19:"RENAME TABLE a FROM";s:3:"len";i:19;s:4:"last";i:19;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:8;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":5:{s:7:"renames";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";N;}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:6;s:4:"from";a:0:{}}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:3:{i:0;a:3:{i:0;s:26:"Keyword "TO" was expected.";i:1;r:51;i:2;i:0;}i:1;a:3:{i:0;s:32:"A rename operation was expected.";i:1;r:44;i:2;i:0;}i:2;a:3:{i:0;s:27:"An expression was expected.";i:1;r:58;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "RENAME TABLE a FROM", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE a FROM", + "len": 19, + "last": 19, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 8 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + "new": null + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 6, + "from": [] + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Keyword \"TO\" was expected.", + { + "@type": "@8" + }, + 0 + ], + [ + "A rename operation was expected.", + { + "@type": "@7" + }, + 0 + ], + [ + "An expression was expected.", + { + "@type": "@9" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRenameErr4.out b/tests/data/parser/parseRenameErr4.out index 6718a2fed..bf415c539 100644 --- a/tests/data/parser/parseRenameErr4.out +++ b/tests/data/parser/parseRenameErr4.out @@ -1 +1,521 @@ -a:4:{s:5:"query";s:26:"RENAME TABLE foo TO bar TO";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:26:"RENAME TABLE foo TO bar TO";s:3:"len";i:26;s:4:"last";i:26;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:12:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"TO";s:5:"value";s:2:"TO";s:7:"keyword";s:2:"TO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:24;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:12;s:3:"idx";i:12;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Components\RenameOperation":2:{s:3:"old";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:3:"new";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"bar";s:6:"column";N;s:4:"expr";s:3:"bar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}s:7:"options";N;s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "RENAME TABLE foo TO bar TO", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME TABLE foo TO bar TO", + "len": 26, + "last": 26, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TO", + "value": "TO", + "keyword": "TO", + "type": 1, + "flags": 3, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 12, + "idx": 12 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "old": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + }, + "new": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "bar", + "column": null, + "expr": "bar", + "alias": null, + "function": null, + "subquery": null + } + } + ], + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unrecognized keyword.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRenameErr5.out b/tests/data/parser/parseRenameErr5.out index 8bfca973e..336a67187 100644 --- a/tests/data/parser/parseRenameErr5.out +++ b/tests/data/parser/parseRenameErr5.out @@ -1,4 +1,390 @@ -a:4:{s:5:"query";s:7:"RENAME -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:7:"RENAME -";s:3:"len";i:7;s:4:"last";i:7;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:3:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"RENAME";s:5:"value";s:6:"RENAME";s:7:"keyword";s:6:"RENAME";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:3;s:3:"idx";i:4;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\RenameStatement":4:{s:7:"renames";N;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:28:"Keyword at end of statement.";i:1;r:9;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "RENAME\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RENAME\n", + "len": 7, + "last": 7, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RENAME", + "value": "RENAME", + "keyword": "RENAME", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 3, + "idx": 4 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "renames": null, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Keyword at end of statement.", + { + "@type": "@2" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplace.out b/tests/data/parser/parseReplace.out index 219b2dcc9..83ccc003c 100644 --- a/tests/data/parser/parseReplace.out +++ b/tests/data/parser/parseReplace.out @@ -1,7 +1,727 @@ -a:4:{s:5:"query";s:75:"REPLACE LOW_PRIORITY -INTO users(id, username) -VALUES (1, 'Foo'), (2, 'Bar')";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:75:"REPLACE LOW_PRIORITY -INTO users(id, username) -VALUES (1, 'Foo'), (2, 'Bar')";s:3:"len";i:75;s:4:"last";i:75;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:31:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:46;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:53;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:54;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'Foo'";s:5:"value";s:3:"Foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:57;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:62;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:65;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:66;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:67;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'Bar'";s:5:"value";s:3:"Bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:69;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:74;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:31;s:3:"idx";i:31;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:2:{i:0;s:2:"id";i:1;s:8:"username";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:2:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:1:"1";i:1;s:5:"'Foo'";}s:6:"values";a:2:{i:0;s:1:"1";i:1;s:3:"Foo";}}i:1;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:1:"2";i:1;s:5:"'Bar'";}s:6:"values";a:2:{i:0;s:1:"2";i:1;s:3:"Bar";}}}s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:12:"LOW_PRIORITY";}}s:5:"first";i:0;s:4:"last";i:29;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "REPLACE LOW_PRIORITY\nINTO users(id, username)\nVALUES (1, 'Foo'), (2, 'Bar')", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE LOW_PRIORITY\nINTO users(id, username)\nVALUES (1, 'Foo'), (2, 'Bar')", + "len": 75, + "last": 75, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Foo'", + "value": "Foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Bar'", + "value": "Bar", + "keyword": null, + "type": 7, + "flags": 1, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 31, + "idx": 31 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "username" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "1", + "'Foo'" + ], + "values": [ + "1", + "Foo" + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "2", + "'Bar'" + ], + "values": [ + "2", + "Bar" + ] + } + ], + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOW_PRIORITY" + } + }, + "first": 0, + "last": 29 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplace2.out b/tests/data/parser/parseReplace2.out index 46b5f7c94..561779794 100644 --- a/tests/data/parser/parseReplace2.out +++ b/tests/data/parser/parseReplace2.out @@ -1,10 +1,649 @@ -a:4:{s:5:"query";s:65:"REPLACE LOW_PRIORITY -INTO users -SET id = 1, - username = 'Bar';";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:65:"REPLACE LOW_PRIORITY -INTO users -SET id = 1, - username = 'Bar';";s:3:"len";i:65;s:4:"last";i:65;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:32;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:39;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:57;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'Bar'";s:5:"value";s:3:"Bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:59;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"id";s:5:"value";s:1:"1";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:8:"username";s:5:"value";s:5:"'Bar'";}}s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:12:"LOW_PRIORITY";}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "REPLACE LOW_PRIORITY\nINTO users\nSET id = 1,\n username = 'Bar';", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE LOW_PRIORITY\nINTO users\nSET id = 1,\n username = 'Bar';", + "len": 65, + "last": 65, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Bar'", + "value": "Bar", + "keyword": null, + "type": 7, + "flags": 1, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "id", + "value": "1" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "username", + "value": "'Bar'" + } + ], + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOW_PRIORITY" + } + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceErr.out b/tests/data/parser/parseReplaceErr.out index bd2f0913d..3251b5baf 100644 --- a/tests/data/parser/parseReplaceErr.out +++ b/tests/data/parser/parseReplaceErr.out @@ -1,7 +1,722 @@ -a:4:{s:5:"query";s:68:"REPLACE LOW_PRIORITY -INTO users(id, username) -(1, 'Foo'), (2, 'Bar')";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:68:"REPLACE LOW_PRIORITY -INTO users(id, username) -(1, 'Foo'), (2, 'Bar')";s:3:"len";i:68;s:4:"last";i:68;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"LOW_PRIORITY";s:5:"value";s:12:"LOW_PRIORITY";s:7:"keyword";s:12:"LOW_PRIORITY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:26;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:31;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:46;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:47;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:48;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'Foo'";s:5:"value";s:3:"Foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:50;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:55;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:56;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:58;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:59;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:60;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'Bar'";s:5:"value";s:3:"Bar";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:62;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:67;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:29;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:2:{i:0;s:2:"id";i:1;s:8:"username";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:12:"LOW_PRIORITY";}}s:5:"first";i:0;s:4:"last";i:13;}}s:8:"brackets";i:2;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:5:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:114;i:2;i:0;}i:2;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:135;i:2;i:0;}i:3;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:170;i:2;i:0;}i:4;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:191;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "REPLACE LOW_PRIORITY\nINTO users(id, username)\n(1, 'Foo'), (2, 'Bar')", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE LOW_PRIORITY\nINTO users(id, username)\n(1, 'Foo'), (2, 'Bar')", + "len": 68, + "last": 68, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOW_PRIORITY", + "value": "LOW_PRIORITY", + "keyword": "LOW_PRIORITY", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Foo'", + "value": "Foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'Bar'", + "value": "Bar", + "keyword": null, + "type": 7, + "flags": 1, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 29 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "id", + "username" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOW_PRIORITY" + } + }, + "first": 0, + "last": 13 + } + ], + "brackets": 2, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@17" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@20" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@25" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@28" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceErr2.out b/tests/data/parser/parseReplaceErr2.out index e579257f4..9cf74dced 100644 --- a/tests/data/parser/parseReplaceErr2.out +++ b/tests/data/parser/parseReplaceErr2.out @@ -1,4 +1,594 @@ -a:4:{s:5:"query";s:15:"REPLACE SELECT -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:15:"REPLACE SELECT -";s:3:"len";i:15;s:4:"last";i:15;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:2:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";N;s:6:"values";N;s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:1;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:0:{}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:2;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:23;i:2;i:0;}i:1;a:3:{i:0;s:27:"An expression was expected.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "REPLACE SELECT\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE SELECT\n", + "len": 15, + "last": 15, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": null, + "values": null, + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 2, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@4" + }, + 0 + ], + [ + "An expression was expected.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceErr3.out b/tests/data/parser/parseReplaceErr3.out index ffc9cf3ea..6c94695ab 100644 --- a/tests/data/parser/parseReplaceErr3.out +++ b/tests/data/parser/parseReplaceErr3.out @@ -1,7 +1,516 @@ -a:4:{s:5:"query";s:25:"REPLACE INTO x "string" - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:25:"REPLACE INTO x "string" - -";s:3:"len";i:25;s:4:"last";i:25;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:""string"";s:5:"value";s:6:"string";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"x";s:6:"column";N;s:4:"expr";s:1:"x";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:5;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:51;i:2;i:0;}i:1;a:3:{i:0;s:34:"Unexpected beginning of statement.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "REPLACE INTO x \"string\"\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE INTO x \"string\"\n\n", + "len": 25, + "last": 25, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 1, + "flags": 33, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"string\"", + "value": "string", + "keyword": null, + "type": 7, + "flags": 2, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "x", + "column": null, + "expr": "x", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 5 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@8" + }, + 0 + ], + [ + "Unexpected beginning of statement.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceIntoErr.out b/tests/data/parser/parseReplaceIntoErr.out index ec26e16f8..348d1c5d4 100644 --- a/tests/data/parser/parseReplaceIntoErr.out +++ b/tests/data/parser/parseReplaceIntoErr.out @@ -1,7 +1,531 @@ -a:4:{s:5:"query";s:23:"REPLACE INTO x INSERT - -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:23:"REPLACE INTO x INSERT - -";s:3:"len";i:23;s:4:"last";i:23;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"INSERT";s:5:"value";s:6:"INSERT";s:7:"keyword";s:6:"INSERT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" - -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:2:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"x";s:6:"column";N;s:4:"expr";s:1:"x";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";N;s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:5;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\InsertStatement":8:{s:4:"into";N;s:6:"values";N;s:3:"set";N;s:6:"select";N;s:14:"onDuplicateSet";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:6;s:4:"last";i:7;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "REPLACE INTO x INSERT\n\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE INTO x INSERT\n\n", + "len": 23, + "last": 23, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 1, + "flags": 33, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INSERT", + "value": "INSERT", + "keyword": "INSERT", + "type": 1, + "flags": 35, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "x", + "column": null, + "expr": "x", + "alias": null, + "function": null, + "subquery": null + }, + "columns": null, + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 2, + "HIGH_PRIORITY": 3, + "IGNORE": 4 + }, + "into": null, + "values": null, + "set": null, + "select": null, + "onDuplicateSet": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 6, + "last": 7 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceSelect.out b/tests/data/parser/parseReplaceSelect.out index ed4455da3..ce69f26ff 100644 --- a/tests/data/parser/parseReplaceSelect.out +++ b/tests/data/parser/parseReplaceSelect.out @@ -1 +1,801 @@ -a:4:{s:5:"query";s:49:"REPLACE INTO `a` (`value`) SELECT value from `b`";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:49:"REPLACE INTO `a` (`value`) SELECT value from `b`";s:3:"len";i:49;s:4:"last";i:49;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"value";s:5:"value";s:5:"value";s:7:"keyword";s:5:"VALUE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`b`";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:46;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";N;s:6:"select";O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"value";s:4:"expr";s:5:"value";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"b";s:6:"column";N;s:4:"expr";s:3:"`b`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:10;s:4:"last";i:16;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "REPLACE INTO `a` (`value`) SELECT value from `b`", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE INTO `a` (`value`) SELECT value from `b`", + "len": 49, + "last": 49, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "value", + "value": "value", + "keyword": "VALUE", + "type": 1, + "flags": 1, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`b`", + "value": "b", + "keyword": null, + "type": 8, + "flags": 2, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": null, + "select": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "value", + "expr": "value", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "b", + "column": null, + "expr": "`b`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 10, + "last": 16 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceSet.out b/tests/data/parser/parseReplaceSet.out index e4b3c6956..b3ef726ef 100644 --- a/tests/data/parser/parseReplaceSet.out +++ b/tests/data/parser/parseReplaceSet.out @@ -1 +1,590 @@ -a:4:{s:5:"query";s:44:"REPLACE INTO `a` (`value`) SET value = '123'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:44:"REPLACE INTO `a` (`value`) SET value = '123'";s:3:"len";i:44;s:4:"last";i:44;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"value";s:5:"value";s:5:"value";s:7:"keyword";s:5:"VALUE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:37;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'123'";s:5:"value";s:3:"123";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:39;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";N;s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:5:"value";s:5:"value";s:5:"'123'";}}s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:16;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "REPLACE INTO `a` (`value`) SET value = '123'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE INTO `a` (`value`) SET value = '123'", + "len": 44, + "last": 44, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "value", + "value": "value", + "keyword": "VALUE", + "type": 1, + "flags": 1, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123'", + "value": "123", + "keyword": null, + "type": 7, + "flags": 1, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": null, + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "value", + "value": "'123'" + } + ], + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 16 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseReplaceValues.out b/tests/data/parser/parseReplaceValues.out index 60cf3962d..a00e84264 100644 --- a/tests/data/parser/parseReplaceValues.out +++ b/tests/data/parser/parseReplaceValues.out @@ -1 +1,630 @@ -a:4:{s:5:"query";s:50:"REPLACE INTO `a` (`value`) VALUES ('123'), ('123')";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:50:"REPLACE INTO `a` (`value`) VALUES ('123'), ('123')";s:3:"len";i:50;s:4:"last";i:50;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"REPLACE";s:5:"value";s:7:"REPLACE";s:7:"keyword";s:7:"REPLACE";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"`a`";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`value`";s:5:"value";s:5:"value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"VALUES";s:5:"value";s:6:"VALUES";s:7:"keyword";s:6:"VALUES";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'123'";s:5:"value";s:3:"123";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'123'";s:5:"value";s:3:"123";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:44;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:49;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\ReplaceStatement":7:{s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";N;s:4:"dest";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:3:"`a`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:7:"columns";a:1:{i:0;s:5:"value";}s:6:"values";N;s:14:"fields_options";N;s:14:"fields_keyword";N;s:13:"lines_options";N;}s:6:"values";a:2:{i:0;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:1:{i:0;s:5:"'123'";}s:6:"values";a:1:{i:0;s:3:"123";}}i:1;O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:1:{i:0;s:5:"'123'";}s:6:"values";a:1:{i:0;s:3:"123";}}}s:3:"set";N;s:6:"select";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:19;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "REPLACE INTO `a` (`value`) VALUES ('123'), ('123')", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "REPLACE INTO `a` (`value`) VALUES ('123'), ('123')", + "len": 50, + "last": 50, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "REPLACE", + "value": "REPLACE", + "keyword": "REPLACE", + "type": 1, + "flags": 35, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`a`", + "value": "a", + "keyword": null, + "type": 8, + "flags": 2, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`value`", + "value": "value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "VALUES", + "value": "VALUES", + "keyword": "VALUES", + "type": 1, + "flags": 35, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123'", + "value": "123", + "keyword": null, + "type": 7, + "flags": 1, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'123'", + "value": "123", + "keyword": null, + "type": 7, + "flags": 1, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "DELAYED": 1 + }, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": null, + "dest": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "`a`", + "alias": null, + "function": null, + "subquery": null + }, + "columns": [ + "value" + ], + "values": null, + "fields_options": null, + "fields_keyword": null, + "lines_options": null + }, + "values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "'123'" + ], + "values": [ + "123" + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "'123'" + ], + "values": [ + "123" + ] + } + ], + "set": null, + "select": null, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 19 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseRestore.out b/tests/data/parser/parseRestore.out index fd93de822..b42e9a582 100644 --- a/tests/data/parser/parseRestore.out +++ b/tests/data/parser/parseRestore.out @@ -1 +1,486 @@ -a:4:{s:5:"query";s:55:"RESTORE TABLE my_table FROM "/path/to/backup/directory"";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:55:"RESTORE TABLE my_table FROM "/path/to/backup/directory"";s:3:"len";i:55;s:4:"last";i:55;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"RESTORE";s:5:"value";s:7:"RESTORE";s:7:"keyword";s:7:"RESTORE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"TABLE";s:5:"value";s:5:"TABLE";s:7:"keyword";s:5:"TABLE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"my_table";s:5:"value";s:8:"my_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:27:""/path/to/backup/directory"";s:5:"value";s:25:"/path/to/backup/directory";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:28;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:48:"PhpMyAdmin\SqlParser\Statements\RestoreStatement":4:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"my_table";s:6:"column";N;s:4:"expr";s:8:"my_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:0;s:5:"TABLE";i:1;a:4:{s:4:"name";s:4:"FROM";s:6:"equals";b:0;s:4:"expr";s:27:""/path/to/backup/directory"";s:5:"value";s:25:"/path/to/backup/directory";}}}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "RESTORE TABLE my_table FROM \"\/path\/to\/backup\/directory\"", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "RESTORE TABLE my_table FROM \"\/path\/to\/backup\/directory\"", + "len": 55, + "last": 55, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RESTORE", + "value": "RESTORE", + "keyword": "RESTORE", + "type": 1, + "flags": 1, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLE", + "value": "TABLE", + "keyword": "TABLE", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_table", + "value": "my_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"\/path\/to\/backup\/directory\"", + "value": "\/path\/to\/backup\/directory", + "keyword": null, + "type": 7, + "flags": 2, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "OPTIONS": { + "TABLE": 1, + "FROM": [ + 2, + "var" + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "my_table", + "column": null, + "expr": "my_table", + "alias": null, + "function": null, + "subquery": null + } + ], + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [ + "TABLE", + { + "name": "FROM", + "equals": false, + "expr": "\"\/path\/to\/backup\/directory\"", + "value": "\/path\/to\/backup\/directory" + } + ] + }, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect.out b/tests/data/parser/parseSelect.out index a2e4a796b..e38dd1946 100644 --- a/tests/data/parser/parseSelect.out +++ b/tests/data/parser/parseSelect.out @@ -1,40 +1,1497 @@ -a:4:{s:5:"query";s:231:"SELECT ALL MAX_STATEMENT_TIME = 10 - 1 + 2 AS result, - @idx, - id, - test.`users`.username AS `name` -FROM - `test`.users, posts - PARTITION (p1, p2) -WHERE - id > 0 -ORDER BY - username DESC, - id -LIMIT 3 OFFSET 2;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:231:"SELECT ALL MAX_STATEMENT_TIME = 10 - 1 + 2 AS result, - @idx, - id, - test.`users`.username AS `name` -FROM - `test`.users, posts - PARTITION (p1, p2) -WHERE - id > 0 -ORDER BY - username DESC, - id -LIMIT 3 OFFSET 2;";s:3:"len";i:231;s:4:"last";i:231;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:81:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ALL";s:5:"value";s:3:"ALL";s:7:"keyword";s:3:"ALL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"MAX_STATEMENT_TIME";s:5:"value";s:18:"MAX_STATEMENT_TIME";s:7:"keyword";s:18:"MAX_STATEMENT_TIME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:30;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:32;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:41;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:43;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"result";s:5:"value";s:6:"result";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:54;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:60;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:70;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:72;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:73;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:82;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`users`";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:83;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:90;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:91;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:100;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`name`";s:5:"value";s:4:"name";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:103;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:109;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:110;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`test`";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:119;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:125;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:126;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:131;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"posts";s:5:"value";s:5:"posts";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:133;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:138;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:143;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:152;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:153;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:154;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:156;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p2";s:5:"value";s:2:"p2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:158;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:160;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:161;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:162;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:167;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:172;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:174;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:">";s:5:"value";s:1:">";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:175;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:177;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:178;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:179;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:187;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:192;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:200;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DESC";s:5:"value";s:4:"DESC";s:7:"keyword";s:4:"DESC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:201;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:205;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:206;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:211;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:213;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:214;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:219;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:220;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:221;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"OFFSET";s:5:"value";s:6:"OFFSET";s:7:"keyword";s:6:"OFFSET";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:222;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:228;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:229;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:230;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:81;s:3:"idx";i:81;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:4:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:5:"1 + 2";s:5:"alias";s:6:"result";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"@idx";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:3;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:4:"test";s:5:"table";s:5:"users";s:6:"column";s:8:"username";s:4:"expr";s:21:"test.`users`.username";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:4:"test";s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:12:"`test`.users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"posts";s:6:"column";N;s:4:"expr";s:5:"posts";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:2:"p1";i:1;s:2:"p2";}s:6:"values";a:2:{i:0;s:2:"p1";i:1;s:2:"p2";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:2:"id";}s:10:"isOperator";b:0;s:4:"expr";s:6:"id > 0";}}s:5:"group";N;s:6:"having";N;s:5:"order";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:8:"username";s:4:"expr";s:8:"username";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:4:"DESC";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:2;s:8:"rowCount";i:3;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:3:"ALL";i:3;a:4:{s:4:"name";s:18:"MAX_STATEMENT_TIME";s:6:"equals";b:1;s:4:"expr";s:2:"10";s:5:"value";s:2:"10";}}}s:5:"first";i:0;s:4:"last";i:78;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT ALL MAX_STATEMENT_TIME = 10\n 1 + 2 AS result,\n @idx,\n id,\n test.`users`.username AS `name`\nFROM\n `test`.users, posts\n PARTITION (p1, p2)\nWHERE\n id > 0\nORDER BY\n username DESC,\n id\nLIMIT 3 OFFSET 2;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT ALL MAX_STATEMENT_TIME = 10\n 1 + 2 AS result,\n @idx,\n id,\n test.`users`.username AS `name`\nFROM\n `test`.users, posts\n PARTITION (p1, p2)\nWHERE\n id > 0\nORDER BY\n username DESC,\n id\nLIMIT 3 OFFSET 2;", + "len": 231, + "last": 231, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALL", + "value": "ALL", + "keyword": "ALL", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MAX_STATEMENT_TIME", + "value": "MAX_STATEMENT_TIME", + "keyword": "MAX_STATEMENT_TIME", + "type": 1, + "flags": 1, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "result", + "value": "result", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`users`", + "value": "users", + "keyword": null, + "type": 8, + "flags": 2, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`name`", + "value": "name", + "keyword": null, + "type": 8, + "flags": 2, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`test`", + "value": "test", + "keyword": null, + "type": 8, + "flags": 2, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "posts", + "value": "posts", + "keyword": null, + "type": 0, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p2", + "value": "p2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 160 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ">", + "value": ">", + "keyword": null, + "type": 2, + "flags": 2, + "position": 175 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 192 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 200 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DESC", + "value": "DESC", + "keyword": "DESC", + "type": 1, + "flags": 3, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 205 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 206 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 211 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 213 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 220 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OFFSET", + "value": "OFFSET", + "keyword": "OFFSET", + "type": 1, + "flags": 1, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 228 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 229 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 230 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 81, + "idx": 81 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1 + 2", + "alias": "result", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "@idx", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "test", + "table": "users", + "column": "username", + "expr": "test.`users`.username", + "alias": "name", + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "test", + "table": "users", + "column": null, + "expr": "`test`.users", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "posts", + "column": null, + "expr": "posts", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "p1", + "p2" + ], + "values": [ + "p1", + "p2" + ] + }, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "id" + ], + "isOperator": false, + "expr": "id > 0" + } + ], + "group": null, + "having": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "username", + "expr": "username", + "alias": null, + "function": null, + "subquery": null + }, + "type": "DESC" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 2, + "rowCount": 3 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ALL", + "3": { + "name": "MAX_STATEMENT_TIME", + "equals": true, + "expr": "10", + "value": "10" + } + } + }, + "first": 0, + "last": 78 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect10.out b/tests/data/parser/parseSelect10.out index f0ec6421f..a281ec197 100644 --- a/tests/data/parser/parseSelect10.out +++ b/tests/data/parser/parseSelect10.out @@ -1,4 +1,834 @@ -a:4:{s:5:"query";s:83:"SELECT my_column FROM my_table WHERE BINARY(my_column) != BINARY(UPPER(my_column)) -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:83:"SELECT my_column FROM my_table WHERE BINARY(my_column) != BINARY(UPPER(my_column)) -";s:3:"len";i:83;s:4:"last";i:83;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"my_column";s:5:"value";s:9:"my_column";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"my_table";s:5:"value";s:8:"my_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"my_column";s:5:"value";s:9:"my_column";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:53;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"!=";s:5:"value";s:2:"!=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:55;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"BINARY";s:5:"value";s:6:"BINARY";s:7:"keyword";s:6:"BINARY";s:4:"type";i:1;s:5:"flags";i:43;s:8:"position";i:58;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:64;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UPPER";s:5:"value";s:5:"UPPER";s:7:"keyword";s:5:"UPPER";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:65;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"my_column";s:5:"value";s:9:"my_column";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:71;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:81;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:26;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:9:"my_column";s:4:"expr";s:9:"my_column";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"my_table";s:6:"column";N;s:4:"expr";s:8:"my_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:9:"my_column";i:1;s:5:"UPPER";}s:10:"isOperator";b:0;s:4:"expr";s:45:"BINARY(my_column) != BINARY(UPPER(my_column))";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:24;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT my_column FROM my_table WHERE BINARY(my_column) != BINARY(UPPER(my_column))\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT my_column FROM my_table WHERE BINARY(my_column) != BINARY(UPPER(my_column))\n", + "len": 83, + "last": 83, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_column", + "value": "my_column", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_table", + "value": "my_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_column", + "value": "my_column", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "!=", + "value": "!=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "BINARY", + "value": "BINARY", + "keyword": "BINARY", + "type": 1, + "flags": 43, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPPER", + "value": "UPPER", + "keyword": "UPPER", + "type": 1, + "flags": 33, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "my_column", + "value": "my_column", + "keyword": null, + "type": 0, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 26 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "my_column", + "expr": "my_column", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "my_table", + "column": null, + "expr": "my_table", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "my_column", + "UPPER" + ], + "isOperator": false, + "expr": "BINARY(my_column) != BINARY(UPPER(my_column))" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 24 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect11.out b/tests/data/parser/parseSelect11.out index d217699b4..ee66d9a1f 100644 --- a/tests/data/parser/parseSelect11.out +++ b/tests/data/parser/parseSelect11.out @@ -1,4 +1,638 @@ -a:4:{s:5:"query";s:19:"SELECT 1 AND NOT 1 -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:19:"SELECT 1 AND NOT 1 -";s:3:"len";i:19;s:4:"last";i:19;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:11:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"NOT";s:5:"value";s:3:"NOT";s:7:"keyword";s:3:"NOT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:13;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:17;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:11;s:3:"idx";i:11;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:11:"1 AND NOT 1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:9;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT 1 AND NOT 1\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT 1 AND NOT 1\n", + "len": 19, + "last": 19, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NOT", + "value": "NOT", + "keyword": "NOT", + "type": 1, + "flags": 3, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 11, + "idx": 11 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1 AND NOT 1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 9 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect2.out b/tests/data/parser/parseSelect2.out index f90ee288d..dce1cf11c 100644 --- a/tests/data/parser/parseSelect2.out +++ b/tests/data/parser/parseSelect2.out @@ -1 +1,906 @@ -a:4:{s:5:"query";s:67:"SELECT (SELECT 'foo') bar, (SELECT 'baz') AS qux, a as b FROM tabl;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:67:"SELECT (SELECT 'foo') bar, (SELECT 'baz') AS qux, a as b FROM tabl;";s:3:"len";i:67;s:4:"last";i:67;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'foo'";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:28;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'baz'";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:35;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"qux";s:5:"value";s:3:"qux";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:48;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:55;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:57;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"tabl";s:5:"value";s:4:"tabl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:62;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:66;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:14:"(SELECT 'foo')";s:5:"alias";s:3:"bar";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:14:"(SELECT 'baz')";s:5:"alias";s:3:"qux";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";s:1:"b";s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"tabl";s:6:"column";N;s:4:"expr";s:4:"tabl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT (SELECT 'foo') bar, (SELECT 'baz') AS qux, a as b FROM tabl;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT (SELECT 'foo') bar, (SELECT 'baz') AS qux, a as b FROM tabl;", + "len": 67, + "last": 67, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'foo'", + "value": "foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'baz'", + "value": "baz", + "keyword": null, + "type": 7, + "flags": 1, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "qux", + "value": "qux", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tabl", + "value": "tabl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT 'foo')", + "alias": "bar", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT 'baz')", + "alias": "qux", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": "b", + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tabl", + "column": null, + "expr": "tabl", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect3.out b/tests/data/parser/parseSelect3.out index 42318da9b..0dc75e7ad 100644 --- a/tests/data/parser/parseSelect3.out +++ b/tests/data/parser/parseSelect3.out @@ -1,7 +1,1018 @@ -a:4:{s:5:"query";s:109:"SELECT left_tbl.* -FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id -WHERE right_tbl.id IS NULL;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:109:"SELECT left_tbl.* -FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id -WHERE right_tbl.id IS NULL;";s:3:"len";i:109;s:4:"last";i:109;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:37:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"left_tbl";s:5:"value";s:8:"left_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"left_tbl";s:5:"value";s:8:"left_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LEFT JOIN";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"right_tbl";s:5:"value";s:9:"right_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"left_tbl";s:5:"value";s:8:"left_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:55;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:64;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:67;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"right_tbl";s:5:"value";s:9:"right_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:69;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:79;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"right_tbl";s:5:"value";s:9:"right_tbl";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:88;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:97;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:98;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IS";s:5:"value";s:2:"IS";s:7:"keyword";s:2:"IS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:101;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:104;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:108;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:37;s:3:"idx";i:37;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"left_tbl";s:6:"column";N;s:4:"expr";s:10:"left_tbl.*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"left_tbl";s:6:"column";N;s:4:"expr";s:8:"left_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:9:"right_tbl";i:1;s:2:"id";}s:10:"isOperator";b:0;s:4:"expr";s:20:"right_tbl.id IS NULL";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"right_tbl";s:6:"column";N;s:4:"expr";s:9:"right_tbl";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:8:"left_tbl";i:1;s:2:"id";i:2;s:9:"right_tbl";}s:10:"isOperator";b:0;s:4:"expr";s:26:"left_tbl.id = right_tbl.id";}}s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:34;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT left_tbl.*\nFROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\nWHERE right_tbl.id IS NULL;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT left_tbl.*\nFROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\nWHERE right_tbl.id IS NULL;", + "len": 109, + "last": 109, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left_tbl", + "value": "left_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left_tbl", + "value": "left_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEFT JOIN", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "right_tbl", + "value": "right_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "left_tbl", + "value": "left_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "right_tbl", + "value": "right_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "right_tbl", + "value": "right_tbl", + "keyword": null, + "type": 0, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IS", + "value": "IS", + "keyword": "IS", + "type": 1, + "flags": 3, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 37, + "idx": 37 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "left_tbl", + "column": null, + "expr": "left_tbl.*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "left_tbl", + "column": null, + "expr": "left_tbl", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "right_tbl", + "id" + ], + "isOperator": false, + "expr": "right_tbl.id IS NULL" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "right_tbl", + "column": null, + "expr": "right_tbl", + "alias": null, + "function": null, + "subquery": null + }, + "on": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "left_tbl", + "id", + "right_tbl" + ], + "isOperator": false, + "expr": "left_tbl.id = right_tbl.id" + } + ], + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 34 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect4.out b/tests/data/parser/parseSelect4.out index 5c1a2f90d..6c52aae56 100644 --- a/tests/data/parser/parseSelect4.out +++ b/tests/data/parser/parseSelect4.out @@ -1,10 +1,816 @@ -a:4:{s:5:"query";s:54:"SELECT * - FROM test - WHERE RIGHT(name, 2) = 'AB'; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:54:"SELECT * - FROM test - WHERE RIGHT(name, 2) = 'AB'; -";s:3:"len";i:54;s:4:"last";i:54;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"RIGHT";s:5:"value";s:5:"RIGHT";s:7:"keyword";s:5:"RIGHT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:31;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:46;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'AB'";s:5:"value";s:2:"AB";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:48;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:52;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"test";s:6:"column";N;s:4:"expr";s:4:"test";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:4:"name";i:1;s:2:"AB";}s:10:"isOperator";b:0;s:4:"expr";s:21:"RIGHT(name, 2) = 'AB'";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:20;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT *\n FROM test\n WHERE RIGHT(name, 2) = 'AB';\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT *\n FROM test\n WHERE RIGHT(name, 2) = 'AB';\n", + "len": 54, + "last": 54, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RIGHT", + "value": "RIGHT", + "keyword": "RIGHT", + "type": 1, + "flags": 35, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'AB'", + "value": "AB", + "keyword": null, + "type": 7, + "flags": 1, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test", + "column": null, + "expr": "test", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "name", + "AB" + ], + "isOperator": false, + "expr": "RIGHT(name, 2) = 'AB'" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 20 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect5.out b/tests/data/parser/parseSelect5.out index 31a4c0c22..8d60f75a6 100644 --- a/tests/data/parser/parseSelect5.out +++ b/tests/data/parser/parseSelect5.out @@ -1,13 +1,1078 @@ -a:4:{s:5:"query";s:123:"SELECT c1, c2, c3 - /* Subquery in FROM list */ - FROM (SELECT C1, c2, c3 FROM test2) t1 - WHERE RIGHT(name, 2) = 'AB'; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:123:"SELECT c1, c2, c3 - /* Subquery in FROM list */ - FROM (SELECT C1, c2, c3 FROM test2) t1 - WHERE RIGHT(name, 2) = 'AB'; -";s:3:"len";i:123;s:4:"last";i:123;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:48:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"c1";s:5:"value";s:2:"c1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"c2";s:5:"value";s:2:"c2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:13;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"c3";s:5:"value";s:2:"c3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:27:"/* Subquery in FROM list */";s:5:"value";s:27:"/* Subquery in FROM list */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:21;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:58;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"C1";s:5:"value";s:2:"C1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:67;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:68;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"c2";s:5:"value";s:2:"c2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:69;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"c3";s:5:"value";s:2:"c3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:73;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"test2";s:5:"value";s:5:"test2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:81;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:94;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"RIGHT";s:5:"value";s:5:"RIGHT";s:7:"keyword";s:5:"RIGHT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:100;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:105;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:106;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:110;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:112;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:115;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:116;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'AB'";s:5:"value";s:2:"AB";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:117;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:121;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:48;s:3:"idx";i:48;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"c1";s:4:"expr";s:2:"c1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"c2";s:4:"expr";s:2:"c2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"c3";s:4:"expr";s:2:"c3";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:30:"(SELECT C1, c2, c3 FROM test2)";s:5:"alias";s:2:"t1";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:4:"name";i:1;s:2:"AB";}s:10:"isOperator";b:0;s:4:"expr";s:21:"RIGHT(name, 2) = 'AB'";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:44;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT c1, c2, c3\n \/* Subquery in FROM list *\/\n FROM (SELECT C1, c2, c3 FROM test2) t1\n WHERE RIGHT(name, 2) = 'AB';\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT c1, c2, c3\n \/* Subquery in FROM list *\/\n FROM (SELECT C1, c2, c3 FROM test2) t1\n WHERE RIGHT(name, 2) = 'AB';\n", + "len": 123, + "last": 123, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c1", + "value": "c1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c2", + "value": "c2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c3", + "value": "c3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* Subquery in FROM list *\/", + "value": "\/* Subquery in FROM list *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "C1", + "value": "C1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c2", + "value": "c2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c3", + "value": "c3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test2", + "value": "test2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "RIGHT", + "value": "RIGHT", + "keyword": "RIGHT", + "type": 1, + "flags": 35, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'AB'", + "value": "AB", + "keyword": null, + "type": 7, + "flags": 1, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 48, + "idx": 48 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "c1", + "expr": "c1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "c2", + "expr": "c2", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "c3", + "expr": "c3", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT C1, c2, c3 FROM test2)", + "alias": "t1", + "function": null, + "subquery": "SELECT" + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "name", + "AB" + ], + "isOperator": false, + "expr": "RIGHT(name, 2) = 'AB'" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 44 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect6.out b/tests/data/parser/parseSelect6.out index 2b40fffcf..b36ad538a 100644 --- a/tests/data/parser/parseSelect6.out +++ b/tests/data/parser/parseSelect6.out @@ -1,7 +1,1265 @@ -a:4:{s:5:"query";s:100:"SELECT * FROM t1 LEFT JOIN (t2, t3, t4) - ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c) -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:100:"SELECT * FROM t1 LEFT JOIN (t2, t3, t4) - ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c) -";s:3:"len";i:100;s:4:"last";i:100;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:53:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LEFT JOIN";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:17;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t4";s:5:"value";s:2:"t4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:57;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:60;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:64;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:65;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:66;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:68;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:69;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:71;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:77;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:79;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:80;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:82;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:83;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:85;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t4";s:5:"value";s:2:"t4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:89;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:91;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:92;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:93;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:94;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:96;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:97;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:98;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:53;s:3:"idx";i:53;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:12:"(t2, t3, t4)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";a:5:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t2";i:1;s:1:"a";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:10:"(t2.a=t1.a";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t3";i:1;s:1:"b";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:9:"t3.b=t1.b";}i:3;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:4;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t4";i:1;s:1:"c";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:10:"t4.c=t1.c)";}}s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:51;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n", + "len": 100, + "last": 100, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEFT JOIN", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t4", + "value": "t4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t4", + "value": "t4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 53, + "idx": 53 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(t2, t3, t4)", + "alias": null, + "function": null, + "subquery": null + }, + "on": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t2", + "a", + "t1" + ], + "isOperator": false, + "expr": "(t2.a=t1.a" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t3", + "b", + "t1" + ], + "isOperator": false, + "expr": "t3.b=t1.b" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t4", + "c", + "t1" + ], + "isOperator": false, + "expr": "t4.c=t1.c)" + } + ], + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 51 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect7.out b/tests/data/parser/parseSelect7.out index 097be0a6c..dd15ceeac 100644 --- a/tests/data/parser/parseSelect7.out +++ b/tests/data/parser/parseSelect7.out @@ -1,4 +1,1274 @@ -a:4:{s:5:"query";s:119:"SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4) - ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:119:"SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4) - ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)";s:3:"len";i:119;s:4:"last";i:119;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:54:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LEFT JOIN";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:17;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CROSS JOIN";s:5:"value";s:10:"CROSS JOIN";s:7:"keyword";s:10:"CROSS JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CROSS JOIN";s:5:"value";s:10:"CROSS JOIN";s:7:"keyword";s:10:"CROSS JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t4";s:5:"value";s:2:"t4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:56;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:58;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:77;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t2";s:5:"value";s:2:"t2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:81;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:84;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:85;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:91;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:94;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t3";s:5:"value";s:2:"t3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:95;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:97;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:98;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:99;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:100;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:102;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:103;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:105;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:108;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t4";s:5:"value";s:2:"t4";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:109;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:111;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:112;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:113;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"t1";s:5:"value";s:2:"t1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:114;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:116;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:117;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:118;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:54;s:3:"idx";i:54;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"t1";s:6:"column";N;s:4:"expr";s:2:"t1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:32:"(t2 CROSS JOIN t3 CROSS JOIN t4)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";a:5:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t2";i:1;s:1:"a";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:10:"(t2.a=t1.a";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t3";i:1;s:1:"b";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:9:"t3.b=t1.b";}i:3;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:4;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:3:{i:0;s:2:"t4";i:1;s:1:"c";i:2;s:2:"t1";}s:10:"isOperator";b:0;s:4:"expr";s:10:"t4.c=t1.c)";}}s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:52;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)", + "len": 119, + "last": 119, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEFT JOIN", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CROSS JOIN", + "value": "CROSS JOIN", + "keyword": "CROSS JOIN", + "type": 1, + "flags": 7, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CROSS JOIN", + "value": "CROSS JOIN", + "keyword": "CROSS JOIN", + "type": 1, + "flags": 7, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t4", + "value": "t4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t2", + "value": "t2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t3", + "value": "t3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t4", + "value": "t4", + "keyword": null, + "type": 0, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t1", + "value": "t1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 54, + "idx": 54 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t1", + "column": null, + "expr": "t1", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(t2 CROSS JOIN t3 CROSS JOIN t4)", + "alias": null, + "function": null, + "subquery": null + }, + "on": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t2", + "a", + "t1" + ], + "isOperator": false, + "expr": "(t2.a=t1.a" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t3", + "b", + "t1" + ], + "isOperator": false, + "expr": "t3.b=t1.b" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "t4", + "c", + "t1" + ], + "isOperator": false, + "expr": "t4.c=t1.c)" + } + ], + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 52 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect8.out b/tests/data/parser/parseSelect8.out index 9f2e40ee7..92679d687 100644 --- a/tests/data/parser/parseSelect8.out +++ b/tests/data/parser/parseSelect8.out @@ -1 +1,955 @@ -a:4:{s:5:"query";s:68:"select * FROM (select Pop FROM MyTable) p join tadaa t where p.x=t.y";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:68:"select * FROM (select Pop FROM MyTable) p join tadaa t where p.x=t.y";s:3:"len";i:68;s:4:"last";i:68;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"Pop";s:5:"value";s:3:"Pop";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:22;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:26;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"MyTable";s:5:"value";s:7:"MyTable";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:39;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"p";s:5:"value";s:1:"p";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:40;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"join";s:5:"value";s:4:"JOIN";s:7:"keyword";s:4:"JOIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"tadaa";s:5:"value";s:5:"tadaa";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:54;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"where";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:55;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"p";s:5:"value";s:1:"p";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:61;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:62;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"x";s:5:"value";s:1:"x";s:7:"keyword";s:1:"X";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:63;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:65;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:66;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"y";s:5:"value";s:1:"y";s:7:"keyword";s:1:"Y";s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:67;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:25:"(select Pop FROM MyTable)";s:5:"alias";s:1:"p";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:4:{i:0;s:1:"p";i:1;s:1:"x";i:2;s:1:"t";i:3;s:1:"y";}s:10:"isOperator";b:0;s:4:"expr";s:7:"p.x=t.y";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"JOIN";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"tadaa";s:6:"column";N;s:4:"expr";s:5:"tadaa";s:5:"alias";s:1:"t";s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:32;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select * FROM (select Pop FROM MyTable) p join tadaa t where p.x=t.y", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select * FROM (select Pop FROM MyTable) p join tadaa t where p.x=t.y", + "len": 68, + "last": 68, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Pop", + "value": "Pop", + "keyword": null, + "type": 0, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MyTable", + "value": "MyTable", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p", + "value": "p", + "keyword": null, + "type": 0, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "join", + "value": "JOIN", + "keyword": "JOIN", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tadaa", + "value": "tadaa", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "where", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p", + "value": "p", + "keyword": null, + "type": 0, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "x", + "value": "x", + "keyword": "X", + "type": 0, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "y", + "value": "y", + "keyword": "Y", + "type": 0, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 34 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(select Pop FROM MyTable)", + "alias": "p", + "function": null, + "subquery": "SELECT" + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "p", + "x", + "t", + "y" + ], + "isOperator": false, + "expr": "p.x=t.y" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "JOIN", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tadaa", + "column": null, + "expr": "tadaa", + "alias": "t", + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 32 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelect9.out b/tests/data/parser/parseSelect9.out index 8995169d4..96a64fa25 100644 --- a/tests/data/parser/parseSelect9.out +++ b/tests/data/parser/parseSelect9.out @@ -1,10 +1,1486 @@ -a:4:{s:5:"query";s:296:"SELECT casein_pipe, email_cp, name_first_cp, name_last_cp, purpose_pipe -FROM (tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp) -WHERE casein_pipe > '2016-03-01' AND `campaign_id_pipe` = 24569 AND `weeksonlist_pipe` = 1 -ORDER BY `tbl_pipelist`.`casein_pipe` ASC";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:296:"SELECT casein_pipe, email_cp, name_first_cp, name_last_cp, purpose_pipe -FROM (tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp) -WHERE casein_pipe > '2016-03-01' AND `campaign_id_pipe` = 24569 AND `weeksonlist_pipe` = 1 -ORDER BY `tbl_pipelist`.`casein_pipe` ASC";s:3:"len";i:296;s:4:"last";i:296;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:70:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"casein_pipe";s:5:"value";s:11:"casein_pipe";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:18;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"email_cp";s:5:"value";s:8:"email_cp";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"name_first_cp";s:5:"value";s:13:"name_first_cp";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:30;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"name_last_cp";s:5:"value";s:12:"name_last_cp";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"purpose_pipe";s:5:"value";s:12:"purpose_pipe";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:72;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:77;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"tbl_comp_person";s:5:"value";s:15:"tbl_comp_person";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:78;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"INNER JOIN";s:5:"value";s:10:"INNER JOIN";s:7:"keyword";s:10:"INNER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:94;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`tbl_pipelist`";s:5:"value";s:12:"tbl_pipelist";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:105;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:119;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:120;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"tbl_comp_person";s:5:"value";s:15:"tbl_comp_person";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:123;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:138;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"IDp";s:5:"value";s:3:"IDp";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:139;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:143;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:144;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"tbl_pipelist";s:5:"value";s:12:"tbl_pipelist";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:145;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:157;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"IDp";s:5:"value";s:3:"IDp";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:158;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:161;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:162;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:163;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:168;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"casein_pipe";s:5:"value";s:11:"casein_pipe";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:169;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:180;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:">";s:5:"value";s:1:">";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:181;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:182;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"'2016-03-01'";s:5:"value";s:10:"2016-03-01";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:183;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:195;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:196;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:199;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`campaign_id_pipe`";s:5:"value";s:16:"campaign_id_pipe";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:201;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:219;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:220;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:221;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"24569";s:5:"value";i:24569;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:222;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:227;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"AND";s:5:"value";s:3:"AND";s:7:"keyword";s:3:"AND";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:228;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:231;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"`weeksonlist_pipe`";s:5:"value";s:16:"weeksonlist_pipe";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:232;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:250;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:251;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:252;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:253;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:254;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:255;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:263;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`tbl_pipelist`";s:5:"value";s:12:"tbl_pipelist";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:264;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:278;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`casein_pipe`";s:5:"value";s:11:"casein_pipe";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:279;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:292;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:293;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:70;s:3:"idx";i:70;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:5:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:11:"casein_pipe";s:4:"expr";s:11:"casein_pipe";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:8:"email_cp";s:4:"expr";s:8:"email_cp";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:13:"name_first_cp";s:4:"expr";s:13:"name_first_cp";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:3;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:12:"name_last_cp";s:4:"expr";s:12:"name_last_cp";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:4;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:12:"purpose_pipe";s:4:"expr";s:12:"purpose_pipe";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:85:"(tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:5:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:11:"casein_pipe";i:1;s:10:"2016-03-01";}s:10:"isOperator";b:0;s:4:"expr";s:26:"casein_pipe > '2016-03-01'";}i:1;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:2;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:16:"campaign_id_pipe";}s:10:"isOperator";b:0;s:4:"expr";s:26:"`campaign_id_pipe` = 24569";}i:3;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:1;s:4:"expr";s:3:"AND";}i:4;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:16:"weeksonlist_pipe";}s:10:"isOperator";b:0;s:4:"expr";s:22:"`weeksonlist_pipe` = 1";}}s:5:"group";N;s:6:"having";N;s:5:"order";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:12:"tbl_pipelist";s:6:"column";s:11:"casein_pipe";s:4:"expr";s:28:"`tbl_pipelist`.`casein_pipe`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:68;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT casein_pipe, email_cp, name_first_cp, name_last_cp, purpose_pipe\nFROM (tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp)\nWHERE casein_pipe > '2016-03-01' AND `campaign_id_pipe` = 24569 AND `weeksonlist_pipe` = 1\nORDER BY `tbl_pipelist`.`casein_pipe` ASC", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT casein_pipe, email_cp, name_first_cp, name_last_cp, purpose_pipe\nFROM (tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp)\nWHERE casein_pipe > '2016-03-01' AND `campaign_id_pipe` = 24569 AND `weeksonlist_pipe` = 1\nORDER BY `tbl_pipelist`.`casein_pipe` ASC", + "len": 296, + "last": 296, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "casein_pipe", + "value": "casein_pipe", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "email_cp", + "value": "email_cp", + "keyword": null, + "type": 0, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name_first_cp", + "value": "name_first_cp", + "keyword": null, + "type": 0, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name_last_cp", + "value": "name_last_cp", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "purpose_pipe", + "value": "purpose_pipe", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl_comp_person", + "value": "tbl_comp_person", + "keyword": null, + "type": 0, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INNER JOIN", + "value": "INNER JOIN", + "keyword": "INNER JOIN", + "type": 1, + "flags": 7, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl_pipelist`", + "value": "tbl_pipelist", + "keyword": null, + "type": 8, + "flags": 2, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl_comp_person", + "value": "tbl_comp_person", + "keyword": null, + "type": 0, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IDp", + "value": "IDp", + "keyword": null, + "type": 0, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl_pipelist", + "value": "tbl_pipelist", + "keyword": null, + "type": 0, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IDp", + "value": "IDp", + "keyword": null, + "type": 0, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "casein_pipe", + "value": "casein_pipe", + "keyword": null, + "type": 0, + "flags": 0, + "position": 169 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 180 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ">", + "value": ">", + "keyword": null, + "type": 2, + "flags": 2, + "position": 181 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'2016-03-01'", + "value": "2016-03-01", + "keyword": null, + "type": 7, + "flags": 1, + "position": 183 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 199 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`campaign_id_pipe`", + "value": "campaign_id_pipe", + "keyword": null, + "type": 8, + "flags": 2, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 220 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "24569", + "value": 24569, + "keyword": null, + "type": 6, + "flags": 0, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 227 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AND", + "value": "AND", + "keyword": "AND", + "type": 1, + "flags": 3, + "position": 228 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 231 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`weeksonlist_pipe`", + "value": "weeksonlist_pipe", + "keyword": null, + "type": 8, + "flags": 2, + "position": 232 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 250 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 251 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 253 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 255 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 263 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tbl_pipelist`", + "value": "tbl_pipelist", + "keyword": null, + "type": 8, + "flags": 2, + "position": 264 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 278 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`casein_pipe`", + "value": "casein_pipe", + "keyword": null, + "type": 8, + "flags": 2, + "position": 279 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 292 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 293 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 70, + "idx": 70 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "casein_pipe", + "expr": "casein_pipe", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "email_cp", + "expr": "email_cp", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name_first_cp", + "expr": "name_first_cp", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name_last_cp", + "expr": "name_last_cp", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "purpose_pipe", + "expr": "purpose_pipe", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(tbl_comp_person INNER JOIN `tbl_pipelist` ON tbl_comp_person.IDp = tbl_pipelist.IDp)", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "casein_pipe", + "2016-03-01" + ], + "isOperator": false, + "expr": "casein_pipe > '2016-03-01'" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "campaign_id_pipe" + ], + "isOperator": false, + "expr": "`campaign_id_pipe` = 24569" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": true, + "expr": "AND" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "weeksonlist_pipe" + ], + "isOperator": false, + "expr": "`weeksonlist_pipe` = 1" + } + ], + "group": null, + "having": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl_pipelist", + "column": "casein_pipe", + "expr": "`tbl_pipelist`.`casein_pipe`", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 68 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCase1.out b/tests/data/parser/parseSelectCase1.out index 3bfc87798..67c8e83dd 100644 --- a/tests/data/parser/parseSelectCase1.out +++ b/tests/data/parser/parseSelectCase1.out @@ -1,4 +1,1115 @@ -a:4:{s:5:"query";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end FROM a;";s:3:"len";i:132;s:4:"last";i:132;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:50:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:50;s:3:"idx";i:50;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";N;s:4:"expr";s:42:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end FROM a;", + "len": 132, + "last": 132, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 50, + "idx": 50 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": null, + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCase2.out b/tests/data/parser/parseSelectCase2.out index 2878bd933..b972b3ca9 100644 --- a/tests/data/parser/parseSelectCase2.out +++ b/tests/data/parser/parseSelectCase2.out @@ -1,4 +1,1123 @@ -a:4:{s:5:"query";s:138:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:138:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" else "Other" end FROM a;";s:3:"len";i:138;s:4:"last";i:138;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:52:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:98;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:127;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:131;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:136;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:137;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:52;s:3:"idx";i:52;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:1:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:0:{}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";N;s:4:"expr";s:42:"CASE WHEN 1=1 THEN "Some" ELSE "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:49;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" else \"Other\" end FROM a;", + "len": 138, + "last": 138, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 52, + "idx": 52 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ] + ], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": null, + "expr": "CASE WHEN 1=1 THEN \"Some\" ELSE \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 49 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCase3.out b/tests/data/parser/parseSelectCase3.out index 8308cce55..55778bb3f 100644 --- a/tests/data/parser/parseSelectCase3.out +++ b/tests/data/parser/parseSelectCase3.out @@ -1,4 +1,1213 @@ -a:4:{s:5:"query";s:147:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:147:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end FROM a;";s:3:"len";i:147;s:4:"last";i:147;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:58:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:98;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:120;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:121;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:123;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:128;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:136;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:140;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:144;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:145;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:146;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:58;s:3:"idx";i:58;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:2:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}i:1;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"2=1";}}}s:7:"results";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:51:"CASE WHEN 1=1 THEN "Some" WHEN 2=1 THEN "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:55;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end FROM a;", + "len": 147, + "last": 147, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 58, + "idx": 58 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "2=1" + } + ] + ], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [], + "else_result": null, + "alias": null, + "expr": "CASE WHEN 1=1 THEN \"Some\" WHEN 2=1 THEN \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 55 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCase4.out b/tests/data/parser/parseSelectCase4.out index f60c049cc..46c0fc181 100644 --- a/tests/data/parser/parseSelectCase4.out +++ b/tests/data/parser/parseSelectCase4.out @@ -1,4 +1,1193 @@ -a:4:{s:5:"query";s:145:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 /* */ when 1 then "Some" when 2 then "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:145:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 /* */ when 1 then "Some" when 2 then "Other" end FROM a;";s:3:"len";i:145;s:4:"last";i:145;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:56:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:94;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:95;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:121;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:126;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:134;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:137;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:138;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:143;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:144;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:56;s:3:"idx";i:56;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:7:"1 /* */";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:55:"CASE 1 /* */ WHEN 1 THEN "Some" WHEN 2 THEN "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:53;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end FROM a;", + "len": 145, + "last": 145, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 144 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 56, + "idx": 56 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1 \/* *\/", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "2", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": null, + "alias": null, + "expr": "CASE 1 \/* *\/ WHEN 1 THEN \"Some\" WHEN 2 THEN \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 53 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCase5.out b/tests/data/parser/parseSelectCase5.out index 2f2a91e1d..1f4524256 100644 --- a/tests/data/parser/parseSelectCase5.out +++ b/tests/data/parser/parseSelectCase5.out @@ -1,4 +1,1108 @@ -a:4:{s:5:"query";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end FROM a;";s:3:"len";i:150;s:4:"last";i:150;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:58:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:105;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:112;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:124;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:131;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:138;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:139;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:143;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:148;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:149;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:58;s:3:"idx";i:58;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"test";s:4:"expr";s:60:"test=CASE 1 /* */ WHEN 1 THEN "Some" WHEN 2 THEN "Other" END";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:55;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end FROM a;", + "len": 150, + "last": 150, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 58, + "idx": 58 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "test", + "expr": "test=CASE 1 \/* *\/ WHEN 1 THEN \"Some\" WHEN 2 THEN \"Other\" END", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 55 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias1.out b/tests/data/parser/parseSelectCaseAlias1.out index 048687dab..eafdb57f0 100644 --- a/tests/data/parser/parseSelectCaseAlias1.out +++ b/tests/data/parser/parseSelectCaseAlias1.out @@ -1,4 +1,1285 @@ -a:4:{s:5:"query";s:166:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end /* */ AS /* */ foo FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:166:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end /* */ AS /* */ foo FROM a;";s:3:"len";i:166;s:4:"last";i:166;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:66:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:98;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:120;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:121;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:123;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:128;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:136;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:140;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:146;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:149;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:155;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:158;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:159;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:163;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:164;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:165;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:66;s:3:"idx";i:66;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:2:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}i:1;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"2=1";}}}s:7:"results";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";s:3:"foo";s:4:"expr";s:60:"CASE WHEN 1=1 THEN "Some" WHEN 2=1 THEN "Other" END AS `foo`";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:63;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end \/* *\/ AS \/* *\/ foo FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end \/* *\/ AS \/* *\/ foo FROM a;", + "len": 166, + "last": 166, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 164 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 165 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 66, + "idx": 66 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "2=1" + } + ] + ], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [], + "else_result": null, + "alias": "foo", + "expr": "CASE WHEN 1=1 THEN \"Some\" WHEN 2=1 THEN \"Other\" END AS `foo`" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 63 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias2.out b/tests/data/parser/parseSelectCaseAlias2.out index f2990a37d..5a4398a89 100644 --- a/tests/data/parser/parseSelectCaseAlias2.out +++ b/tests/data/parser/parseSelectCaseAlias2.out @@ -1,4 +1,1249 @@ -a:4:{s:5:"query";s:157:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end /* */ foo FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:157:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case /* */ when 1=1 then "Some" when 2=1 then "Other" end /* */ foo FROM a;";s:3:"len";i:157;s:4:"last";i:157;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:62:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:93;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:98;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:102;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:114;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:120;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:121;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:122;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:123;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:128;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:136;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:140;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:145;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:146;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:149;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:150;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:155;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:156;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:62;s:3:"idx";i:62;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:2:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}i:1;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"2=1";}}}s:7:"results";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";s:3:"foo";s:4:"expr";s:60:"CASE WHEN 1=1 THEN "Some" WHEN 2=1 THEN "Other" END AS `foo`";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:59;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end \/* *\/ foo FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase \/* *\/ when 1=1 then \"Some\" when 2=1 then \"Other\" end \/* *\/ foo FROM a;", + "len": 157, + "last": 157, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 122 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 145 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 146 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 62, + "idx": 62 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "2=1" + } + ] + ], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [], + "else_result": null, + "alias": "foo", + "expr": "CASE WHEN 1=1 THEN \"Some\" WHEN 2=1 THEN \"Other\" END AS `foo`" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 59 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias3.out b/tests/data/parser/parseSelectCaseAlias3.out index e747e85d0..0fd51985e 100644 --- a/tests/data/parser/parseSelectCaseAlias3.out +++ b/tests/data/parser/parseSelectCaseAlias3.out @@ -1,4 +1,1180 @@ -a:4:{s:5:"query";s:169:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end /* */ AS /* */ foo FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:169:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end /* */ AS /* */ foo FROM a;";s:3:"len";i:169;s:4:"last";i:169;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:66:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:105;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:112;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:124;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:131;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:138;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:139;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:143;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:149;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:151;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:152;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:158;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:161;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:162;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:166;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:167;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:168;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:66;s:3:"idx";i:66;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"test";s:4:"expr";s:69:"test=CASE 1 /* */ WHEN 1 THEN "Some" WHEN 2 THEN "Other" END AS `foo`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:63;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end \/* *\/ AS \/* *\/ foo FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end \/* *\/ AS \/* *\/ foo FROM a;", + "len": 169, + "last": 169, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 161 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 166 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 168 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 66, + "idx": 66 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "test", + "expr": "test=CASE 1 \/* *\/ WHEN 1 THEN \"Some\" WHEN 2 THEN \"Other\" END AS `foo`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 63 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias4.out b/tests/data/parser/parseSelectCaseAlias4.out index 836a5131e..4b075fe1e 100644 --- a/tests/data/parser/parseSelectCaseAlias4.out +++ b/tests/data/parser/parseSelectCaseAlias4.out @@ -1,4 +1,1144 @@ -a:4:{s:5:"query";s:160:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end /* */ foo FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:160:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -test=case 1 /* */ when 1 then "Some" when 2 then "Other" end /* */ foo FROM a;";s:3:"len";i:160;s:4:"last";i:160;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:62:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:99;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:100;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:104;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:105;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:106;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:107;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:112;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:118;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:119;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:123;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:124;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:131;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:138;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:139;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"/* */";s:5:"value";s:5:"/* */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:143;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:148;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:149;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:152;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:153;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:157;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:158;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:159;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:62;s:3:"idx";i:62;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"test";s:4:"expr";s:69:"test=CASE 1 /* */ WHEN 1 THEN "Some" WHEN 2 THEN "Other" END AS `foo`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:59;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end \/* *\/ foo FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ntest=case 1 \/* *\/ when 1 then \"Some\" when 2 then \"Other\" end \/* *\/ foo FROM a;", + "len": 160, + "last": 160, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* *\/", + "value": "\/* *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 158 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 159 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 62, + "idx": 62 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "test", + "expr": "test=CASE 1 \/* *\/ WHEN 1 THEN \"Some\" WHEN 2 THEN \"Other\" END AS `foo`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 59 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias5.out b/tests/data/parser/parseSelectCaseAlias5.out index d77052999..77a83baaa 100644 --- a/tests/data/parser/parseSelectCaseAlias5.out +++ b/tests/data/parser/parseSelectCaseAlias5.out @@ -1,4 +1,1151 @@ -a:4:{s:5:"query";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS "string value" FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS "string value" FROM a;";s:3:"len";i:150;s:4:"last";i:150;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:54:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:""string value"";s:5:"value";s:12:"string value";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:143;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:148;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:149;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:54;s:3:"idx";i:54;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";s:12:"string value";s:4:"expr";s:60:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END AS `string value`";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:51;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS \"string value\" FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS \"string value\" FROM a;", + "len": 150, + "last": 150, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"string value\"", + "value": "string value", + "keyword": null, + "type": 7, + "flags": 2, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 54, + "idx": 54 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": "string value", + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END AS `string value`" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 51 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAlias6.out b/tests/data/parser/parseSelectCaseAlias6.out index afc14b1a9..9e5da45cd 100644 --- a/tests/data/parser/parseSelectCaseAlias6.out +++ b/tests/data/parser/parseSelectCaseAlias6.out @@ -1,4 +1,1151 @@ -a:4:{s:5:"query";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS `symbol_value` FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:150:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS `symbol_value` FROM a;";s:3:"len";i:150;s:4:"last";i:150;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:54:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`symbol_value`";s:5:"value";s:12:"symbol_value";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:143;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:148;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:149;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:54;s:3:"idx";i:54;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";s:12:"symbol_value";s:4:"expr";s:60:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END AS `symbol_value`";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:51;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS `symbol_value` FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS `symbol_value` FROM a;", + "len": 150, + "last": 150, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`symbol_value`", + "value": "symbol_value", + "keyword": null, + "type": 8, + "flags": 2, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 54, + "idx": 54 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": "symbol_value", + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END AS `symbol_value`" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 51 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAliasErr1.out b/tests/data/parser/parseSelectCaseAliasErr1.out index 454fe1c48..a91b87c96 100644 --- a/tests/data/parser/parseSelectCaseAliasErr1.out +++ b/tests/data/parser/parseSelectCaseAliasErr1.out @@ -1,4 +1,1198 @@ -a:4:{s:5:"query";s:142:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS AS foo FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:142:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS AS foo FROM a;";s:3:"len";i:142;s:4:"last";i:142;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:56:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:130;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:131;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:135;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:139;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:140;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:141;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:56;s:3:"idx";i:56;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";N;s:4:"expr";s:42:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:53;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:45:"Potential duplicate alias of CASE expression.";i:1;r:338;i:2;i:0;}i:1;a:3:{i:0;s:31:"An alias was expected after AS.";i:1;r:331;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:338;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:352;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS AS foo FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS AS foo FROM a;", + "len": 142, + "last": 142, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 139 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 56, + "idx": 56 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": null, + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 53 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Potential duplicate alias of CASE expression.", + { + "@type": "@49" + }, + 0 + ], + [ + "An alias was expected after AS.", + { + "@type": "@48" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@49" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@51" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAliasErr2.out b/tests/data/parser/parseSelectCaseAliasErr2.out index 77a6b445e..3d1b28be8 100644 --- a/tests/data/parser/parseSelectCaseAliasErr2.out +++ b/tests/data/parser/parseSelectCaseAliasErr2.out @@ -1,4 +1,1141 @@ -a:4:{s:5:"query";s:135:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:135:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS FROM a;";s:3:"len";i:135;s:4:"last";i:135;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:52:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:133;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:134;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:52;s:3:"idx";i:52;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";N;s:4:"expr";s:42:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:49;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:39:"An alias expected after AS but got FROM";i:1;r:338;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS FROM a;", + "len": 135, + "last": 135, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 52, + "idx": 52 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": null, + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 49 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias expected after AS but got FROM", + { + "@type": "@49" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAliasErr3.out b/tests/data/parser/parseSelectCaseAliasErr3.out index 7a575d180..62fa00f22 100644 --- a/tests/data/parser/parseSelectCaseAliasErr3.out +++ b/tests/data/parser/parseSelectCaseAliasErr3.out @@ -1,4 +1,1184 @@ -a:4:{s:5:"query";s:143:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS foo bar FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:143:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" else "Other" end AS foo bar FROM a;";s:3:"len";i:143;s:4:"last";i:143;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:56:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:132;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:135;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:136;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:140;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:141;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:142;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:56;s:3:"idx";i:56;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"Other";s:4:"expr";s:7:""Other"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";s:3:"foo";s:4:"expr";s:51:"CASE 1 WHEN 1 THEN "Some" ELSE "Other" END AS `foo`";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:53;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:30:"An alias was previously found.";i:1;r:352;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:352;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS foo bar FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" else \"Other\" end AS foo bar FROM a;", + "len": 143, + "last": 143, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 56, + "idx": 56 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Other", + "expr": "\"Other\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": "foo", + "expr": "CASE 1 WHEN 1 THEN \"Some\" ELSE \"Other\" END AS `foo`" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 53 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was previously found.", + { + "@type": "@51" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@51" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseAliasErr4.out b/tests/data/parser/parseSelectCaseAliasErr4.out index d75e3e7a4..c4ebc50a1 100644 --- a/tests/data/parser/parseSelectCaseAliasErr4.out +++ b/tests/data/parser/parseSelectCaseAliasErr4.out @@ -1 +1,850 @@ -a:4:{s:5:"query";s:76:"SELECT CASE WHEN 2 IS NULL THEN "this is true" ELSE "this is false" END AS ;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:76:"SELECT CASE WHEN 2 IS NULL THEN "this is true" ELSE "this is false" END AS ;";s:3:"len";i:76;s:4:"last";i:76;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:26:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"CASE";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"WHEN";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"IS";s:5:"value";s:2:"IS";s:7:"keyword";s:2:"IS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"NULL";s:5:"value";s:4:"NULL";s:7:"keyword";s:4:"NULL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"THEN";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:27;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:""this is true"";s:5:"value";s:12:"this is true";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"ELSE";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:""this is false"";s:5:"value";s:13:"this is false";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:52;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"END";s:5:"value";s:3:"END";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:68;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:72;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:75;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:26;s:3:"idx";i:26;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:1:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:9:"2 IS NULL";}}}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:12:"this is true";s:4:"expr";s:14:""this is true"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:0:{}s:11:"else_result";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:13:"this is false";s:4:"expr";s:15:""this is false"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"alias";N;s:4:"expr";s:64:"CASE WHEN 2 IS NULL THEN "this is true" ELSE "this is false" END";}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:23;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:31:"An alias was expected after AS.";i:1;r:170;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT CASE WHEN 2 IS NULL THEN \"this is true\" ELSE \"this is false\" END AS ;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT CASE WHEN 2 IS NULL THEN \"this is true\" ELSE \"this is false\" END AS ;", + "len": 76, + "last": 76, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CASE", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHEN", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IS", + "value": "IS", + "keyword": "IS", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NULL", + "value": "NULL", + "keyword": "NULL", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "THEN", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"this is true\"", + "value": "this is true", + "keyword": null, + "type": 7, + "flags": 2, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ELSE", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"this is false\"", + "value": "this is false", + "keyword": null, + "type": 7, + "flags": 2, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "END", + "value": "END", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 26, + "idx": 26 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "2 IS NULL" + } + ] + ], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "this is true", + "expr": "\"this is true\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [], + "else_result": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "this is false", + "expr": "\"this is false\"", + "alias": null, + "function": null, + "subquery": null + }, + "alias": null, + "expr": "CASE WHEN 2 IS NULL THEN \"this is true\" ELSE \"this is false\" END" + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 23 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "An alias was expected after AS.", + { + "@type": "@25" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseErr1.out b/tests/data/parser/parseSelectCaseErr1.out index e68235ed5..d04b52002 100644 --- a/tests/data/parser/parseSelectCaseErr1.out +++ b/tests/data/parser/parseSelectCaseErr1.out @@ -1 +1,1109 @@ -a:4:{s:5:"query";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, case 1 then 1 then "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, case 1 then 1 then "Some" else "Other" end FROM a;";s:3:"len";i:132;s:4:"last";i:132;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:50:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:50;s:3:"idx";i:50;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:0:{}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:0:"";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:9:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:226;i:2;i:0;}i:1;a:3:{i:0;s:33:"Unexpected end of CASE expression";i:1;r:219;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:226;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:240;i:2;i:0;}i:4;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:254;i:2;i:0;}i:5;a:3:{i:0;s:17:"Unexpected token.";i:1;r:268;i:2;i:0;}i:6;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:282;i:2;i:0;}i:7;a:3:{i:0;s:17:"Unexpected token.";i:1;r:296;i:2;i:0;}i:8;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:310;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, case 1 then 1 then \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, case 1 then 1 then \"Some\" else \"Other\" end FROM a;", + "len": 132, + "last": 132, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 50, + "idx": 50 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [], + "compare_values": [], + "else_result": null, + "alias": null, + "expr": "" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected end of CASE expression", + { + "@type": "@32" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@35" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@37" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@39" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@41" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@43" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@45" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseErr2.out b/tests/data/parser/parseSelectCaseErr2.out index aedbe1cd4..5c8443c48 100644 --- a/tests/data/parser/parseSelectCaseErr2.out +++ b/tests/data/parser/parseSelectCaseErr2.out @@ -1,4 +1,1101 @@ -a:4:{s:5:"query";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case then 1=1 then "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case then 1=1 then "Some" else "Other" end FROM a;";s:3:"len";i:132;s:4:"last";i:132;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:50:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:50;s:3:"idx";i:50;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:0:{}s:7:"results";a:0:{}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:0:"";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:11:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:212;i:2;i:0;}i:1;a:3:{i:0;s:33:"Unexpected end of CASE expression";i:1;r:205;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:212;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:226;i:2;i:0;}i:4;a:3:{i:0;s:17:"Unexpected token.";i:1;r:233;i:2;i:0;}i:5;a:3:{i:0;s:17:"Unexpected token.";i:1;r:240;i:2;i:0;}i:6;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:254;i:2;i:0;}i:7;a:3:{i:0;s:17:"Unexpected token.";i:1;r:268;i:2;i:0;}i:8;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:282;i:2;i:0;}i:9;a:3:{i:0;s:17:"Unexpected token.";i:1;r:296;i:2;i:0;}i:10;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:310;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase then 1=1 then \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase then 1=1 then \"Some\" else \"Other\" end FROM a;", + "len": 132, + "last": 132, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 50, + "idx": 50 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [], + "results": [], + "compare_values": [], + "else_result": null, + "alias": null, + "expr": "" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@31" + }, + 0 + ], + [ + "Unexpected end of CASE expression", + { + "@type": "@30" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@31" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@34" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@35" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@37" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@39" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@41" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@43" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@45" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseErr3.out b/tests/data/parser/parseSelectCaseErr3.out index 8f618c81e..a1c129c36 100644 --- a/tests/data/parser/parseSelectCaseErr3.out +++ b/tests/data/parser/parseSelectCaseErr3.out @@ -1,4 +1,1109 @@ -a:4:{s:5:"query";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case when 1=1 when "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case when 1=1 when "Some" else "Other" end FROM a;";s:3:"len";i:132;s:4:"last";i:132;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:50:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:50;s:3:"idx";i:50;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";N;s:10:"conditions";a:1:{i:0;a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}}s:7:"results";a:0:{}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:0:"";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:7:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:254;i:2;i:0;}i:1;a:3:{i:0;s:33:"Unexpected end of CASE expression";i:1;r:247;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:254;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:268;i:2;i:0;}i:4;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:282;i:2;i:0;}i:5;a:3:{i:0;s:17:"Unexpected token.";i:1;r:296;i:2;i:0;}i:6;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:310;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase when 1=1 when \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase when 1=1 when \"Some\" else \"Other\" end FROM a;", + "len": 132, + "last": 132, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 50, + "idx": 50 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": null, + "conditions": [ + [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ] + ], + "results": [], + "compare_values": [], + "else_result": null, + "alias": null, + "expr": "" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@37" + }, + 0 + ], + [ + "Unexpected end of CASE expression", + { + "@type": "@36" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@37" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@39" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@41" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@43" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@45" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseErr4.out b/tests/data/parser/parseSelectCaseErr4.out index ae2e63e99..2620f0d70 100644 --- a/tests/data/parser/parseSelectCaseErr4.out +++ b/tests/data/parser/parseSelectCaseErr4.out @@ -1,4 +1,1109 @@ -a:4:{s:5:"query";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 then 1 when "Some" else "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:132:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 then 1 when "Some" else "Other" end FROM a;";s:3:"len";i:132;s:4:"last";i:132;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:50:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"else";s:5:"value";s:4:"ELSE";s:7:"keyword";s:4:"ELSE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:120;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:121;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:124;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:125;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:129;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:130;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:50;s:3:"idx";i:50;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:0:{}s:14:"compare_values";a:0:{}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:0:"";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:47;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:9:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:226;i:2;i:0;}i:1;a:3:{i:0;s:33:"Unexpected end of CASE expression";i:1;r:219;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:226;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:240;i:2;i:0;}i:4;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:254;i:2;i:0;}i:5;a:3:{i:0;s:17:"Unexpected token.";i:1;r:268;i:2;i:0;}i:6;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:282;i:2;i:0;}i:7;a:3:{i:0;s:17:"Unexpected token.";i:1;r:296;i:2;i:0;}i:8;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:310;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 then 1 when \"Some\" else \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 then 1 when \"Some\" else \"Other\" end FROM a;", + "len": 132, + "last": 132, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "else", + "value": "ELSE", + "keyword": "ELSE", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 124 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 129 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 130 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 50, + "idx": 50 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [], + "compare_values": [], + "else_result": null, + "alias": null, + "expr": "" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 47 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected end of CASE expression", + { + "@type": "@32" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@33" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@35" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@37" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@39" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@41" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@43" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@45" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectCaseErr5.out b/tests/data/parser/parseSelectCaseErr5.out index 18f9bf05a..9dc4c1a8d 100644 --- a/tests/data/parser/parseSelectCaseErr5.out +++ b/tests/data/parser/parseSelectCaseErr5.out @@ -1,4 +1,1188 @@ -a:4:{s:5:"query";s:139:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" when 2 when "Other" end FROM a;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:139:"select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name, -case 1 when 1 then "Some" when 2 when "Other" end FROM a;";s:3:"len";i:139;s:4:"last";i:139;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:54:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"mysql";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"help_category";s:5:"value";s:13:"help_category";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:16:"help_category_id";s:5:"value";s:16:"help_category_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:68;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:69;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"name";s:5:"value";s:4:"name";s:7:"keyword";s:4:"NAME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"case";s:5:"value";s:4:"CASE";s:7:"keyword";s:4:"CASE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:88;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:89;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:93;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:94;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:95;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"then";s:5:"value";s:4:"THEN";s:7:"keyword";s:4:"THEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:96;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:100;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Some"";s:5:"value";s:4:"Some";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:101;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:113;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:114;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"when";s:5:"value";s:4:"WHEN";s:7:"keyword";s:4:"WHEN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:115;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:119;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:""Other"";s:5:"value";s:5:"Other";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:120;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"end";s:5:"value";s:3:"end";s:7:"keyword";s:3:"END";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:128;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:132;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:136;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:137;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:138;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:54;s:3:"idx";i:54;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:65:"(SELECT name FROM mysql.help_category WHERE help_category_id = 1)";s:5:"alias";s:4:"name";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:46:"PhpMyAdmin\SqlParser\Components\CaseExpression":7:{s:5:"value";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:10:"conditions";a:0:{}s:7:"results";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Some";s:4:"expr";s:6:""Some"";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:14:"compare_values";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"else_result";N;s:5:"alias";N;s:4:"expr";s:0:"";}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"a";s:6:"column";N;s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:51;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:5:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:310;i:2;i:0;}i:1;a:3:{i:0;s:33:"Unexpected end of CASE expression";i:1;r:303;i:2;i:0;}i:2;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:310;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:324;i:2;i:0;}i:4;a:3:{i:0;s:21:"Unrecognized keyword.";i:1;r:338;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" when 2 when \"Other\" end FROM a;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" when 2 when \"Other\" end FROM a;", + "len": 139, + "last": 139, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "mysql", + "value": "mysql", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category", + "value": "help_category", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "help_category_id", + "value": "help_category_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name", + "value": "name", + "keyword": "NAME", + "type": 1, + "flags": 1, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "case", + "value": "CASE", + "keyword": "CASE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "then", + "value": "THEN", + "keyword": "THEN", + "type": 1, + "flags": 3, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Some\"", + "value": "Some", + "keyword": null, + "type": 7, + "flags": 2, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "when", + "value": "WHEN", + "keyword": "WHEN", + "type": 1, + "flags": 3, + "position": 115 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Other\"", + "value": "Other", + "keyword": null, + "type": 7, + "flags": 2, + "position": 120 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "end", + "value": "end", + "keyword": "END", + "type": 1, + "flags": 1, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 54, + "idx": 54 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)", + "alias": "name", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression", + "value": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + "conditions": [], + "results": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Some", + "expr": "\"Some\"", + "alias": null, + "function": null, + "subquery": null + } + ], + "compare_values": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "2", + "alias": null, + "function": null, + "subquery": null + } + ], + "else_result": null, + "alias": null, + "expr": "" + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "a", + "column": null, + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 51 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@45" + }, + 0 + ], + [ + "Unexpected end of CASE expression", + { + "@type": "@44" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@45" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@47" + }, + 0 + ], + [ + "Unrecognized keyword.", + { + "@type": "@49" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectEndOptions1.out b/tests/data/parser/parseSelectEndOptions1.out index 13301f4ce..f34ada965 100644 --- a/tests/data/parser/parseSelectEndOptions1.out +++ b/tests/data/parser/parseSelectEndOptions1.out @@ -1 +1,834 @@ -a:4:{s:5:"query";s:86:"SELECT pid, name2 FROM tablename WHERE pid = 20 /* FOR UPDATE end_option */ FOR UPDATE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:86:"SELECT pid, name2 FROM tablename WHERE pid = 20 /* FOR UPDATE end_option */ FOR UPDATE";s:3:"len";i:86;s:4:"last";i:86;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"name2";s:5:"value";s:5:"name2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"20";s:5:"value";i:20;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:27:"/* FOR UPDATE end_option */";s:5:"value";s:27:"/* FOR UPDATE end_option */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"FOR UPDATE";s:5:"value";s:10:"FOR UPDATE";s:7:"keyword";s:10:"FOR UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:76;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"pid";s:4:"expr";s:3:"pid";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"name2";s:4:"expr";s:5:"name2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tablename";s:6:"column";N;s:4:"expr";s:9:"tablename";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:3:"pid";}s:10:"isOperator";b:0;s:4:"expr";s:8:"pid = 20";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:10:"FOR UPDATE";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT pid, name2 FROM tablename WHERE pid = 20 \/* FOR UPDATE end_option *\/ FOR UPDATE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT pid, name2 FROM tablename WHERE pid = 20 \/* FOR UPDATE end_option *\/ FOR UPDATE", + "len": 86, + "last": 86, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name2", + "value": "name2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tablename", + "value": "tablename", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "20", + "value": 20, + "keyword": null, + "type": 6, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* FOR UPDATE end_option *\/", + "value": "\/* FOR UPDATE end_option *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR UPDATE", + "value": "FOR UPDATE", + "keyword": "FOR UPDATE", + "type": 1, + "flags": 7, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "pid", + "expr": "pid", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name2", + "expr": "name2", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tablename", + "column": null, + "expr": "tablename", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "pid" + ], + "isOperator": false, + "expr": "pid = 20" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "FOR UPDATE" + } + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectEndOptions2.out b/tests/data/parser/parseSelectEndOptions2.out index 038d8b25e..709d919d9 100644 --- a/tests/data/parser/parseSelectEndOptions2.out +++ b/tests/data/parser/parseSelectEndOptions2.out @@ -1,4 +1,834 @@ -a:4:{s:5:"query";s:102:"SELECT pid, name2 FROM tablename WHERE pid = 20 -/* LOCK IN SHARE MODE end_option */ LOCK IN SHARE MODE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:102:"SELECT pid, name2 FROM tablename WHERE pid = 20 -/* LOCK IN SHARE MODE end_option */ LOCK IN SHARE MODE";s:3:"len";i:102;s:4:"last";i:102;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"name2";s:5:"value";s:5:"name2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"20";s:5:"value";i:20;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:35:"/* LOCK IN SHARE MODE end_option */";s:5:"value";s:35:"/* LOCK IN SHARE MODE end_option */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:83;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"LOCK IN SHARE MODE";s:5:"value";s:18:"LOCK IN SHARE MODE";s:7:"keyword";s:18:"LOCK IN SHARE MODE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:84;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"pid";s:4:"expr";s:3:"pid";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"name2";s:4:"expr";s:5:"name2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tablename";s:6:"column";N;s:4:"expr";s:9:"tablename";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:3:"pid";}s:10:"isOperator";b:0;s:4:"expr";s:8:"pid = 20";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:18:"LOCK IN SHARE MODE";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT pid, name2 FROM tablename WHERE pid = 20\n\/* LOCK IN SHARE MODE end_option *\/ LOCK IN SHARE MODE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT pid, name2 FROM tablename WHERE pid = 20\n\/* LOCK IN SHARE MODE end_option *\/ LOCK IN SHARE MODE", + "len": 102, + "last": 102, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name2", + "value": "name2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tablename", + "value": "tablename", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "20", + "value": 20, + "keyword": null, + "type": 6, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* LOCK IN SHARE MODE end_option *\/", + "value": "\/* LOCK IN SHARE MODE end_option *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK IN SHARE MODE", + "value": "LOCK IN SHARE MODE", + "keyword": "LOCK IN SHARE MODE", + "type": 1, + "flags": 7, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "pid", + "expr": "pid", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name2", + "expr": "name2", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tablename", + "column": null, + "expr": "tablename", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "pid" + ], + "isOperator": false, + "expr": "pid = 20" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "LOCK IN SHARE MODE" + } + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectEndOptionsErr.out b/tests/data/parser/parseSelectEndOptionsErr.out index 0052a74b1..c904860f8 100644 --- a/tests/data/parser/parseSelectEndOptionsErr.out +++ b/tests/data/parser/parseSelectEndOptionsErr.out @@ -1,7 +1,861 @@ -a:4:{s:5:"query";s:116:"SELECT pid, name2 FROM tablename WHERE pid = 20 -/* USE both end_option, gives error */ -FOR UPDATE LOCK IN SHARE MODE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:116:"SELECT pid, name2 FROM tablename WHERE pid = 20 -/* USE both end_option, gives error */ -FOR UPDATE LOCK IN SHARE MODE";s:3:"len";i:116;s:4:"last";i:116;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:25:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"name2";s:5:"value";s:5:"name2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:43;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"20";s:5:"value";i:20;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:45;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:38:"/* USE both end_option, gives error */";s:5:"value";s:38:"/* USE both end_option, gives error */";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:2;s:8:"position";i:48;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"FOR UPDATE";s:5:"value";s:10:"FOR UPDATE";s:7:"keyword";s:10:"FOR UPDATE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:87;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"LOCK IN SHARE MODE";s:5:"value";s:18:"LOCK IN SHARE MODE";s:7:"keyword";s:18:"LOCK IN SHARE MODE";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:98;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:25;s:3:"idx";i:25;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"pid";s:4:"expr";s:3:"pid";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"name2";s:4:"expr";s:5:"name2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tablename";s:6:"column";N;s:4:"expr";s:9:"tablename";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:3:"pid";}s:10:"isOperator";b:0;s:4:"expr";s:8:"pid = 20";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:1;s:10:"FOR UPDATE";i:3;s:18:"LOCK IN SHARE MODE";}}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:23;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:40:"This option conflicts with "FOR UPDATE".";i:1;r:170;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT pid, name2 FROM tablename WHERE pid = 20\n\/* USE both end_option, gives error *\/\nFOR UPDATE LOCK IN SHARE MODE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT pid, name2 FROM tablename WHERE pid = 20\n\/* USE both end_option, gives error *\/\nFOR UPDATE LOCK IN SHARE MODE", + "len": 116, + "last": 116, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name2", + "value": "name2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tablename", + "value": "tablename", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "20", + "value": 20, + "keyword": null, + "type": 6, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\/* USE both end_option, gives error *\/", + "value": "\/* USE both end_option, gives error *\/", + "keyword": null, + "type": 4, + "flags": 2, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR UPDATE", + "value": "FOR UPDATE", + "keyword": "FOR UPDATE", + "type": 1, + "flags": 7, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LOCK IN SHARE MODE", + "value": "LOCK IN SHARE MODE", + "keyword": "LOCK IN SHARE MODE", + "type": 1, + "flags": 7, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 25, + "idx": 25 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "pid", + "expr": "pid", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name2", + "expr": "name2", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tablename", + "column": null, + "expr": "tablename", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "pid" + ], + "isOperator": false, + "expr": "pid = 20" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "FOR UPDATE", + "3": "LOCK IN SHARE MODE" + } + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 23 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This option conflicts with \"FOR UPDATE\".", + { + "@type": "@25" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectErr1.out b/tests/data/parser/parseSelectErr1.out index 3845dd659..9085f198a 100644 --- a/tests/data/parser/parseSelectErr1.out +++ b/tests/data/parser/parseSelectErr1.out @@ -1,40 +1,1454 @@ -a:4:{s:5:"query";s:220:"SELECT ALL DISTINCT MAX_STATEMENT_TIME = 10 - 1 + 2 AS result, - @idx, - id, - test.`users`.username AS -FROM - `test`.users - PARTITION (p1, p2) -WHERE - id > 0 -ORDER BY - username DESC, - id -LIMIT 2, 3;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:220:"SELECT ALL DISTINCT MAX_STATEMENT_TIME = 10 - 1 + 2 AS result, - @idx, - id, - test.`users`.username AS -FROM - `test`.users - PARTITION (p1, p2) -WHERE - id > 0 -ORDER BY - username DESC, - id -LIMIT 2, 3;";s:3:"len";i:220;s:4:"last";i:220;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:77:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ALL";s:5:"value";s:3:"ALL";s:7:"keyword";s:3:"ALL";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"MAX_STATEMENT_TIME";s:5:"value";s:18:"MAX_STATEMENT_TIME";s:7:"keyword";s:18:"MAX_STATEMENT_TIME";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:39;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:48;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:52;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"result";s:5:"value";s:6:"result";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:57;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:63;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"@idx";s:5:"value";s:3:"idx";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:69;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:79;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:81;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"test";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:87;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:91;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`users`";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:92;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:99;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:100;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:108;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"AS";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:109;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:112;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:116;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`test`";s:5:"value";s:4:"test";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:121;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:127;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:128;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:133;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"PARTITION";s:5:"value";s:9:"PARTITION";s:7:"keyword";s:9:"PARTITION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:138;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:147;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:148;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p1";s:5:"value";s:2:"p1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:149;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:151;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:152;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"p2";s:5:"value";s:2:"p2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:153;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:155;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:156;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:157;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:162;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:167;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:169;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:">";s:5:"value";s:1:">";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:170;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:171;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:172;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:173;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:174;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:182;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:187;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:195;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"DESC";s:5:"value";s:4:"DESC";s:7:"keyword";s:4:"DESC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:196;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:200;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:201;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:206;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:208;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:209;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:214;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:215;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:216;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:217;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"3";s:5:"value";i:3;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:218;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:219;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:77;s:3:"idx";i:77;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:4:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:5:"1 + 2";s:5:"alias";s:6:"result";s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:4:"@idx";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:3;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:4:"test";s:5:"table";s:5:"users";s:6:"column";s:8:"username";s:4:"expr";s:21:"test.`users`.username";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:4:"test";s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:12:"`test`.users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";O:40:"PhpMyAdmin\SqlParser\Components\ArrayObj":2:{s:3:"raw";a:2:{i:0;s:2:"p1";i:1;s:2:"p2";}s:6:"values";a:2:{i:0;s:2:"p1";i:1;s:2:"p2";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:2:"id";}s:10:"isOperator";b:0;s:4:"expr";s:6:"id > 0";}}s:5:"group";N;s:6:"having";N;s:5:"order";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:8:"username";s:4:"expr";s:8:"username";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:4:"DESC";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:2;s:8:"rowCount";i:3;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;s:3:"ALL";i:3;a:4:{s:4:"name";s:18:"MAX_STATEMENT_TIME";s:6:"equals";b:1;s:4:"expr";s:2:"10";s:5:"value";s:2:"10";}i:13;s:8:"DISTINCT";}}s:5:"first";i:0;s:4:"last";i:74;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:2:{i:0;a:3:{i:0;s:33:"This option conflicts with "ALL".";i:1;r:37;i:2;i:0;}i:1;a:3:{i:0;s:22:"An alias was expected.";i:1;r:261;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT ALL DISTINCT MAX_STATEMENT_TIME = 10\n 1 + 2 AS result,\n @idx,\n id,\n test.`users`.username AS\nFROM\n `test`.users\n PARTITION (p1, p2)\nWHERE\n id > 0\nORDER BY\n username DESC,\n id\nLIMIT 2, 3;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT ALL DISTINCT MAX_STATEMENT_TIME = 10\n 1 + 2 AS result,\n @idx,\n id,\n test.`users`.username AS\nFROM\n `test`.users\n PARTITION (p1, p2)\nWHERE\n id > 0\nORDER BY\n username DESC,\n id\nLIMIT 2, 3;", + "len": 220, + "last": 220, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ALL", + "value": "ALL", + "keyword": "ALL", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "MAX_STATEMENT_TIME", + "value": "MAX_STATEMENT_TIME", + "keyword": "MAX_STATEMENT_TIME", + "type": 1, + "flags": 1, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "result", + "value": "result", + "keyword": null, + "type": 0, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@idx", + "value": "idx", + "keyword": null, + "type": 8, + "flags": 1, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test", + "value": "test", + "keyword": null, + "type": 0, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`users`", + "value": "users", + "keyword": null, + "type": 8, + "flags": 2, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "AS", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 116 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`test`", + "value": "test", + "keyword": null, + "type": 8, + "flags": 2, + "position": 121 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 133 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "PARTITION", + "value": "PARTITION", + "keyword": "PARTITION", + "type": 1, + "flags": 3, + "position": 138 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 147 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 148 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p1", + "value": "p1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "p2", + "value": "p2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 153 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 156 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 157 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 167 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 169 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ">", + "value": ">", + "keyword": null, + "type": 2, + "flags": 2, + "position": 170 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 171 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 172 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 173 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 174 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 182 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 187 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 195 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DESC", + "value": "DESC", + "keyword": "DESC", + "type": 1, + "flags": 3, + "position": 196 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 200 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 206 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 208 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 209 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 214 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 215 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 216 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 217 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "3", + "value": 3, + "keyword": null, + "type": 6, + "flags": 0, + "position": 218 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 219 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 77, + "idx": 77 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "1 + 2", + "alias": "result", + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "@idx", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "test", + "table": "users", + "column": "username", + "expr": "test.`users`.username", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "test", + "table": "users", + "column": null, + "expr": "`test`.users", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "raw": [ + "p1", + "p2" + ], + "values": [ + "p1", + "p2" + ] + }, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "id" + ], + "isOperator": false, + "expr": "id > 0" + } + ], + "group": null, + "having": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "username", + "expr": "username", + "alias": null, + "function": null, + "subquery": null + }, + "type": "DESC" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 2, + "rowCount": 3 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ALL", + "3": { + "name": "MAX_STATEMENT_TIME", + "equals": true, + "expr": "10", + "value": "10" + }, + "13": "DISTINCT" + } + }, + "first": 0, + "last": 74 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This option conflicts with \"ALL\".", + { + "@type": "@6" + }, + 0 + ], + [ + "An alias was expected.", + { + "@type": "@38" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectErr2.out b/tests/data/parser/parseSelectErr2.out index 33dff6e2f..c2db7f24f 100644 --- a/tests/data/parser/parseSelectErr2.out +++ b/tests/data/parser/parseSelectErr2.out @@ -1,4 +1,751 @@ -a:4:{s:5:"query";s:35:"select * from foobar where foo = @ -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:35:"select * from foobar where foo = @ -";s:3:"len";i:35;s:4:"last";i:35;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"select";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"from";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"foobar";s:5:"value";s:6:"foobar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"where";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:30;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:31;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"@";s:5:"value";s:0:"";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:33;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:16;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"foobar";s:6:"column";N;s:4:"expr";s:6:"foobar";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:3:"foo";i:1;s:0:"";}s:10:"isOperator";b:0;s:4:"expr";s:7:"foo = @";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:14;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:1:{i:0;a:4:{i:0;s:27:"Variable name was expected.";i:1;s:1:" -";i:2;i:34;i:3;i:0;}}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "select * from foobar where foo = @\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "select * from foobar where foo = @\n", + "len": 35, + "last": 35, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "select", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "from", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foobar", + "value": "foobar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "where", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@", + "value": "", + "keyword": null, + "type": 8, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 16 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foobar", + "column": null, + "expr": "foobar", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "foo", + "" + ], + "isOperator": false, + "expr": "foo = @" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 14 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [ + [ + "Variable name was expected.", + "\n", + 34, + 0 + ] + ], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectExists.out b/tests/data/parser/parseSelectExists.out index 17304652a..b10a0494c 100644 --- a/tests/data/parser/parseSelectExists.out +++ b/tests/data/parser/parseSelectExists.out @@ -1,4 +1,629 @@ -a:4:{s:5:"query";s:24:"SELECT EXISTS(SELECT 1) -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:24:"SELECT EXISTS(SELECT 1) -";s:3:"len";i:24;s:4:"last";i:24;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"EXISTS";s:5:"value";s:6:"EXISTS";s:7:"keyword";s:6:"EXISTS";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:21;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:16:"EXISTS(SELECT 1)";s:5:"alias";N;s:8:"function";s:6:"EXISTS";s:8:"subquery";s:6:"SELECT";}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT EXISTS(SELECT 1)\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT EXISTS(SELECT 1)\n", + "len": 24, + "last": 24, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "EXISTS", + "value": "EXISTS", + "keyword": "EXISTS", + "type": 1, + "flags": 35, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "EXISTS(SELECT 1)", + "alias": null, + "function": "EXISTS", + "subquery": "SELECT" + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHint1.out b/tests/data/parser/parseSelectIndexHint1.out index 01f0ebdbb..d85883622 100644 --- a/tests/data/parser/parseSelectIndexHint1.out +++ b/tests/data/parser/parseSelectIndexHint1.out @@ -1 +1,1022 @@ -a:4:{s:5:"query";s:101:"SELECT * FROM address FORCE INDEX (idx_fk_city_id) IGNORE KEY FOR GROUP BY (a, b,c) WHERE city_id<0;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:101:"SELECT * FROM address FORCE INDEX (idx_fk_city_id) IGNORE KEY FOR GROUP BY (a, b,c) WHERE city_id<0;";s:3:"len";i:101;s:4:"last";i:101;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:40:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:28;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"INDEX";s:5:"value";s:5:"INDEX";s:7:"keyword";s:5:"INDEX";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:29;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:34;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"IGNORE";s:5:"value";s:6:"IGNORE";s:7:"keyword";s:6:"IGNORE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:52;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:59;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"FOR";s:5:"value";s:3:"FOR";s:7:"keyword";s:3:"FOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"GROUP BY";s:5:"value";s:8:"GROUP BY";s:7:"keyword";s:8:"GROUP BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:67;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:77;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:79;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:80;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:81;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:85;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"city_id";s:5:"value";s:7:"city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:91;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"<";s:5:"value";s:1:"<";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:98;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:99;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:100;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:40;s:3:"idx";i:40;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:2:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:5:"FORCE";s:10:"indexOrKey";s:5:"INDEX";s:3:"for";N;s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:16:"(idx_fk_city_id)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}i:1;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:6:"IGNORE";s:10:"indexOrKey";s:3:"KEY";s:3:"for";s:8:"GROUP BY";s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:8:"(a, b,c)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}}s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:7:"city_id";}s:10:"isOperator";b:0;s:4:"expr";s:9:"city_id<0";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:37;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM address FORCE INDEX (idx_fk_city_id) IGNORE KEY FOR GROUP BY (a, b,c) WHERE city_id<0;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address FORCE INDEX (idx_fk_city_id) IGNORE KEY FOR GROUP BY (a, b,c) WHERE city_id<0;", + "len": 101, + "last": 101, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INDEX", + "value": "INDEX", + "keyword": "INDEX", + "type": 1, + "flags": 19, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "IGNORE", + "value": "IGNORE", + "keyword": "IGNORE", + "type": 1, + "flags": 3, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR", + "value": "FOR", + "keyword": "FOR", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "GROUP BY", + "value": "GROUP BY", + "keyword": "GROUP BY", + "type": 1, + "flags": 7, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "city_id", + "value": "city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "<", + "value": "<", + "keyword": null, + "type": 2, + "flags": 2, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 100 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 40, + "idx": 40 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "FORCE", + "indexOrKey": "INDEX", + "for": null, + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(idx_fk_city_id)", + "alias": null, + "function": null, + "subquery": null + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "IGNORE", + "indexOrKey": "KEY", + "for": "GROUP BY", + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(a, b,c)", + "alias": null, + "function": null, + "subquery": null + } + ] + } + ], + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "city_id" + ], + "isOperator": false, + "expr": "city_id<0" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 37 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHint2.out b/tests/data/parser/parseSelectIndexHint2.out index df0dede8b..45c26867f 100644 --- a/tests/data/parser/parseSelectIndexHint2.out +++ b/tests/data/parser/parseSelectIndexHint2.out @@ -1 +1,1013 @@ -a:4:{s:5:"query";s:97:"SELECT * FROM address USE INDEX (idx_fk_city_id) FORCE KEY FOR GROUP BY (a, b,c) WHERE city_id<0";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:97:"SELECT * FROM address USE INDEX (idx_fk_city_id) FORCE KEY FOR GROUP BY (a, b,c) WHERE city_id<0";s:3:"len";i:97;s:4:"last";i:97;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:39:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"USE";s:5:"value";s:3:"USE";s:7:"keyword";s:3:"USE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"INDEX";s:5:"value";s:5:"INDEX";s:7:"keyword";s:5:"INDEX";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:48;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"KEY";s:5:"value";s:3:"KEY";s:7:"keyword";s:3:"KEY";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:56;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"FOR";s:5:"value";s:3:"FOR";s:7:"keyword";s:3:"FOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:60;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:63;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"GROUP BY";s:5:"value";s:8:"GROUP BY";s:7:"keyword";s:8:"GROUP BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:64;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:74;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:75;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:77;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:78;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"c";s:5:"value";s:1:"c";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:79;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:80;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"city_id";s:5:"value";s:7:"city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:88;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"<";s:5:"value";s:1:"<";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:95;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:96;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:39;s:3:"idx";i:39;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:2:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:3:"USE";s:10:"indexOrKey";s:5:"INDEX";s:3:"for";N;s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:16:"(idx_fk_city_id)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}i:1;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:5:"FORCE";s:10:"indexOrKey";s:3:"KEY";s:3:"for";s:8:"GROUP BY";s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:8:"(a, b,c)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}}s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:7:"city_id";}s:10:"isOperator";b:0;s:4:"expr";s:9:"city_id<0";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:37;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM address USE INDEX (idx_fk_city_id) FORCE KEY FOR GROUP BY (a, b,c) WHERE city_id<0", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address USE INDEX (idx_fk_city_id) FORCE KEY FOR GROUP BY (a, b,c) WHERE city_id<0", + "len": 97, + "last": 97, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "USE", + "value": "USE", + "keyword": "USE", + "type": 1, + "flags": 3, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INDEX", + "value": "INDEX", + "keyword": "INDEX", + "type": 1, + "flags": 19, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "KEY", + "value": "KEY", + "keyword": "KEY", + "type": 1, + "flags": 19, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR", + "value": "FOR", + "keyword": "FOR", + "type": 1, + "flags": 3, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "GROUP BY", + "value": "GROUP BY", + "keyword": "GROUP BY", + "type": 1, + "flags": 7, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "c", + "value": "c", + "keyword": null, + "type": 0, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "city_id", + "value": "city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "<", + "value": "<", + "keyword": null, + "type": 2, + "flags": 2, + "position": 95 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 39, + "idx": 39 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "USE", + "indexOrKey": "INDEX", + "for": null, + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(idx_fk_city_id)", + "alias": null, + "function": null, + "subquery": null + } + ] + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "FORCE", + "indexOrKey": "KEY", + "for": "GROUP BY", + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(a, b,c)", + "alias": null, + "function": null, + "subquery": null + } + ] + } + ], + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "city_id" + ], + "isOperator": false, + "expr": "city_id<0" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 37 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHintErr1.out b/tests/data/parser/parseSelectIndexHintErr1.out index 890441354..a7bca9439 100644 --- a/tests/data/parser/parseSelectIndexHintErr1.out +++ b/tests/data/parser/parseSelectIndexHintErr1.out @@ -1 +1,756 @@ -a:4:{s:5:"query";s:49:"SELECT * FROM address FORCE INT (idx_fk_city_id);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:49:"SELECT * FROM address FORCE INT (idx_fk_city_id);";s:3:"len";i:49;s:4:"last";i:49;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:48;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:5:"FORCE";s:10:"indexOrKey";N;s:3:"for";N;s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:16:"(idx_fk_city_id)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}}s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:14;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM address FORCE INT (idx_fk_city_id);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address FORCE INT (idx_fk_city_id);", + "len": 49, + "last": 49, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "FORCE", + "indexOrKey": null, + "for": null, + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(idx_fk_city_id)", + "alias": null, + "function": null, + "subquery": null + } + ] + } + ], + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 14 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHintErr2.out b/tests/data/parser/parseSelectIndexHintErr2.out index 018627df6..04cfd3625 100644 --- a/tests/data/parser/parseSelectIndexHintErr2.out +++ b/tests/data/parser/parseSelectIndexHintErr2.out @@ -1 +1,745 @@ -a:4:{s:5:"query";s:49:"SELECT * FROM address FORCE abc (idx_fk_city_id);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:49:"SELECT * FROM address FORCE abc (idx_fk_city_id);";s:3:"len";i:49;s:4:"last";i:49;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"abc";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:33;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:47;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:48;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:0:{}s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:14;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:79;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:93;i:2;i:0;}i:2;a:3:{i:0;s:17:"Unexpected token.";i:1;r:100;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM address FORCE abc (idx_fk_city_id);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address FORCE abc (idx_fk_city_id);", + "len": 49, + "last": 49, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abc", + "value": "abc", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [], + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 14 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@12" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@14" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@15" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHintErr3.out b/tests/data/parser/parseSelectIndexHintErr3.out index 899da1e57..3171a3d0a 100644 --- a/tests/data/parser/parseSelectIndexHintErr3.out +++ b/tests/data/parser/parseSelectIndexHintErr3.out @@ -1 +1,781 @@ -a:4:{s:5:"query";s:59:"SELECT * FROM address FORCE INDEX FOR abc (idx_fk_city_id);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:59:"SELECT * FROM address FORCE INDEX FOR abc (idx_fk_city_id);";s:3:"len";i:59;s:4:"last";i:59;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"INDEX";s:5:"value";s:5:"INDEX";s:7:"keyword";s:5:"INDEX";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"FOR";s:5:"value";s:3:"FOR";s:7:"keyword";s:3:"FOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"abc";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:58;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:0:{}s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:4:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:107;i:2;i:0;}i:1;a:3:{i:0;s:17:"Unexpected token.";i:1;r:121;i:2;i:0;}i:2;a:3:{i:0;s:17:"Unexpected token.";i:1;r:128;i:2;i:0;}i:3;a:3:{i:0;s:17:"Unexpected token.";i:1;r:135;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM address FORCE INDEX FOR abc (idx_fk_city_id);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address FORCE INDEX FOR abc (idx_fk_city_id);", + "len": 59, + "last": 59, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INDEX", + "value": "INDEX", + "keyword": "INDEX", + "type": 1, + "flags": 19, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR", + "value": "FOR", + "keyword": "FOR", + "type": 1, + "flags": 3, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abc", + "value": "abc", + "keyword": null, + "type": 0, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [], + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@16" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@18" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@19" + }, + 0 + ], + [ + "Unexpected token.", + { + "@type": "@20" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIndexHintErr4.out b/tests/data/parser/parseSelectIndexHintErr4.out index 472533448..2bb3acc69 100644 --- a/tests/data/parser/parseSelectIndexHintErr4.out +++ b/tests/data/parser/parseSelectIndexHintErr4.out @@ -1 +1,792 @@ -a:4:{s:5:"query";s:59:"SELECT * FROM address FORCE INDEX FOR INT (idx_fk_city_id);";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:59:"SELECT * FROM address FORCE INDEX FOR INT (idx_fk_city_id);";s:3:"len";i:59;s:4:"last";i:59;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:21:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"address";s:5:"value";s:7:"address";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"FORCE";s:5:"value";s:5:"FORCE";s:7:"keyword";s:5:"FORCE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"INDEX";s:5:"value";s:5:"INDEX";s:7:"keyword";s:5:"INDEX";s:4:"type";i:1;s:5:"flags";i:19;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"FOR";s:5:"value";s:3:"FOR";s:7:"keyword";s:3:"FOR";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"INT";s:5:"value";s:3:"INT";s:7:"keyword";s:3:"INT";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:38;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"idx_fk_city_id";s:5:"value";s:14:"idx_fk_city_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:57;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:58;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:21;s:3:"idx";i:21;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:7:"address";s:6:"column";N;s:4:"expr";s:7:"address";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\IndexHint":4:{s:4:"type";s:5:"FORCE";s:10:"indexOrKey";s:5:"INDEX";s:3:"for";N;s:7:"indexes";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:16:"(idx_fk_city_id)";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}}}s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:18;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Unexpected keyword.";i:1;r:107;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT * FROM address FORCE INDEX FOR INT (idx_fk_city_id);", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM address FORCE INDEX FOR INT (idx_fk_city_id);", + "len": 59, + "last": 59, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "address", + "value": "address", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FORCE", + "value": "FORCE", + "keyword": "FORCE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INDEX", + "value": "INDEX", + "keyword": "INDEX", + "type": 1, + "flags": 19, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FOR", + "value": "FOR", + "keyword": "FOR", + "type": 1, + "flags": 3, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INT", + "value": "INT", + "keyword": "INT", + "type": 1, + "flags": 11, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "idx_fk_city_id", + "value": "idx_fk_city_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 21, + "idx": 21 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "address", + "column": null, + "expr": "address", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "type": "FORCE", + "indexOrKey": "INDEX", + "for": null, + "indexes": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(idx_fk_city_id)", + "alias": null, + "function": null, + "subquery": null + } + ] + } + ], + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 18 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected keyword.", + { + "@type": "@16" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIntoOptions1.out b/tests/data/parser/parseSelectIntoOptions1.out index 393202a99..02f0026c3 100644 --- a/tests/data/parser/parseSelectIntoOptions1.out +++ b/tests/data/parser/parseSelectIntoOptions1.out @@ -1,12 +1,1087 @@ -a:4:{s:5:"query";s:152:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - LINES TERMINATED BY '\n' - FROM test_table;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:152:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - LINES TERMINATED BY '\n' - FROM test_table;";s:3:"len";i:152;s:4:"last";i:152;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:39:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:12;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"OUTFILE";s:5:"value";s:7:"OUTFILE";s:7:"keyword";s:7:"OUTFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'/tmp/result.txt'";s:5:"value";s:15:"/tmp/result.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"FIELDS";s:5:"value";s:6:"FIELDS";s:7:"keyword";s:6:"FIELDS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:57;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"OPTIONALLY";s:5:"value";s:10:"OPTIONALLY";s:7:"keyword";s:10:"OPTIONALLY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:75;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"ENCLOSED BY";s:5:"value";s:11:"ENCLOSED BY";s:7:"keyword";s:11:"ENCLOSED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:86;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'\"'";s:5:"value";s:1:""";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:98;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:107;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:113;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:126;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'\n'";s:5:"value";s:1:" -";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:127;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:131;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:136;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:140;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"test_table";s:5:"value";s:10:"test_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:141;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:151;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:39;s:3:"idx";i:39;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"b";s:4:"expr";s:1:"b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:3:"a+b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"test_table";s:6:"column";N;s:4:"expr";s:10:"test_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";s:7:"OUTFILE";s:4:"dest";s:15:"/tmp/result.txt";s:7:"columns";N;s:6:"values";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}i:2;s:10:"OPTIONALLY";i:3;a:4:{s:4:"name";s:11:"ENCLOSED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:""";s:4:"expr";s:4:"'\"'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"'\"'";}}}s:14:"fields_keyword";b:1;s:13:"lines_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:" -";s:4:"expr";s:4:"'\n'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"'\n'";}}}}s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:36;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n FROM test_table;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n FROM test_table;", + "len": 152, + "last": 152, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OUTFILE", + "value": "OUTFILE", + "keyword": "OUTFILE", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/result.txt'", + "value": "\/tmp\/result.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FIELDS", + "value": "FIELDS", + "keyword": "FIELDS", + "type": 1, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OPTIONALLY", + "value": "OPTIONALLY", + "keyword": "OPTIONALLY", + "type": 1, + "flags": 3, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENCLOSED BY", + "value": "ENCLOSED BY", + "keyword": "ENCLOSED BY", + "type": 1, + "flags": 7, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\\\"'", + "value": "\"", + "keyword": null, + "type": 7, + "flags": 1, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\\n'", + "value": "\n", + "keyword": null, + "type": 7, + "flags": 1, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 131 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 136 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 140 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test_table", + "value": "test_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 151 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 39, + "idx": 39 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "b", + "expr": "b", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a+b", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test_table", + "column": null, + "expr": "test_table", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": "OUTFILE", + "dest": "\/tmp\/result.txt", + "columns": null, + "values": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + }, + "2": "OPTIONALLY", + "3": { + "name": "ENCLOSED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\"", + "expr": "'\\\"'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\\\"'" + } + } + }, + "fields_keyword": true, + "lines_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\n", + "expr": "'\\n'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\\n'" + } + } + } + }, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 36 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIntoOptions2.out b/tests/data/parser/parseSelectIntoOptions2.out index 93b04b6cb..23de3ad96 100644 --- a/tests/data/parser/parseSelectIntoOptions2.out +++ b/tests/data/parser/parseSelectIntoOptions2.out @@ -1,12 +1,1087 @@ -a:4:{s:5:"query";s:153:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - LINES TERMINATED BY '\n' - FROM test_table;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:153:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - LINES TERMINATED BY '\n' - FROM test_table;";s:3:"len";i:153;s:4:"last";i:153;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:39:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:12;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"OUTFILE";s:5:"value";s:7:"OUTFILE";s:7:"keyword";s:7:"OUTFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'/tmp/result.txt'";s:5:"value";s:15:"/tmp/result.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLUMNS";s:5:"value";s:7:"COLUMNS";s:7:"keyword";s:7:"COLUMNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:58;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:72;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"OPTIONALLY";s:5:"value";s:10:"OPTIONALLY";s:7:"keyword";s:10:"OPTIONALLY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"ENCLOSED BY";s:5:"value";s:11:"ENCLOSED BY";s:7:"keyword";s:11:"ENCLOSED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:87;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'\"'";s:5:"value";s:1:""";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:99;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LINES";s:5:"value";s:5:"LINES";s:7:"keyword";s:5:"LINES";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:113;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:114;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:127;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'\n'";s:5:"value";s:1:" -";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:128;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:132;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:137;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:141;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"test_table";s:5:"value";s:10:"test_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:142;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:152;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:39;s:3:"idx";i:39;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"b";s:4:"expr";s:1:"b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:3:"a+b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"test_table";s:6:"column";N;s:4:"expr";s:10:"test_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";s:7:"OUTFILE";s:4:"dest";s:15:"/tmp/result.txt";s:7:"columns";N;s:6:"values";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}i:2;s:10:"OPTIONALLY";i:3;a:4:{s:4:"name";s:11:"ENCLOSED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:""";s:4:"expr";s:4:"'\"'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"'\"'";}}}s:14:"fields_keyword";b:0;s:13:"lines_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:2;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:" -";s:4:"expr";s:4:"'\n'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"'\n'";}}}}s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:36;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n FROM test_table;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n FROM test_table;", + "len": 153, + "last": 153, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OUTFILE", + "value": "OUTFILE", + "keyword": "OUTFILE", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/result.txt'", + "value": "\/tmp\/result.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMNS", + "value": "COLUMNS", + "keyword": "COLUMNS", + "type": 1, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OPTIONALLY", + "value": "OPTIONALLY", + "keyword": "OPTIONALLY", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENCLOSED BY", + "value": "ENCLOSED BY", + "keyword": "ENCLOSED BY", + "type": 1, + "flags": 7, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\\\"'", + "value": "\"", + "keyword": null, + "type": 7, + "flags": 1, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LINES", + "value": "LINES", + "keyword": "LINES", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 114 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 127 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\\n'", + "value": "\n", + "keyword": null, + "type": 7, + "flags": 1, + "position": 128 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 132 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 137 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test_table", + "value": "test_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 152 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 39, + "idx": 39 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "b", + "expr": "b", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a+b", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test_table", + "column": null, + "expr": "test_table", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": "OUTFILE", + "dest": "\/tmp\/result.txt", + "columns": null, + "values": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + }, + "2": "OPTIONALLY", + "3": { + "name": "ENCLOSED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\"", + "expr": "'\\\"'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\\\"'" + } + } + }, + "fields_keyword": false, + "lines_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "2": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\n", + "expr": "'\\n'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\\n'" + } + } + } + }, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 36 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectIntoOptions3.out b/tests/data/parser/parseSelectIntoOptions3.out index 10bc751ed..53b7e8106 100644 --- a/tests/data/parser/parseSelectIntoOptions3.out +++ b/tests/data/parser/parseSelectIntoOptions3.out @@ -1,7 +1,1001 @@ -a:4:{s:5:"query";s:124:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - FROM test_table;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:124:"SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' - COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' - FROM test_table;";s:3:"len";i:124;s:4:"last";i:124;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"+";s:5:"value";s:1:"+";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:1;s:8:"position";i:12;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:13;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"INTO";s:5:"value";s:4:"INTO";s:7:"keyword";s:4:"INTO";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:15;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"OUTFILE";s:5:"value";s:7:"OUTFILE";s:7:"keyword";s:7:"OUTFILE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'/tmp/result.txt'";s:5:"value";s:15:"/tmp/result.txt";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:28;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:45;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLUMNS";s:5:"value";s:7:"COLUMNS";s:7:"keyword";s:7:"COLUMNS";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:50;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:57;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"TERMINATED BY";s:5:"value";s:13:"TERMINATED BY";s:7:"keyword";s:13:"TERMINATED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:58;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"','";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:72;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:75;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"OPTIONALLY";s:5:"value";s:10:"OPTIONALLY";s:7:"keyword";s:10:"OPTIONALLY";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:76;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:86;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"ENCLOSED BY";s:5:"value";s:11:"ENCLOSED BY";s:7:"keyword";s:11:"ENCLOSED BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:87;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:98;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"'\"'";s:5:"value";s:1:""";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:99;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:103;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:108;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:112;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"test_table";s:5:"value";s:10:"test_table";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:113;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:123;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"b";s:4:"expr";s:1:"b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:3:"a+b";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"test_table";s:6:"column";N;s:4:"expr";s:10:"test_table";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";O:43:"PhpMyAdmin\SqlParser\Components\IntoKeyword":7:{s:4:"type";s:7:"OUTFILE";s:4:"dest";s:15:"/tmp/result.txt";s:7:"columns";N;s:6:"values";N;s:14:"fields_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:3:{i:1;a:4:{s:4:"name";s:13:"TERMINATED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:",";s:4:"expr";s:3:"','";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:3:"','";}i:2;s:10:"OPTIONALLY";i:3;a:4:{s:4:"name";s:11:"ENCLOSED BY";s:6:"equals";b:0;s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:""";s:4:"expr";s:4:"'\"'";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:5:"value";s:4:"'\"'";}}}s:14:"fields_keyword";b:0;s:13:"lines_options";N;}s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n FROM test_table;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT a,b,a+b INTO OUTFILE '\/tmp\/result.txt'\n COLUMNS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\\\"'\n FROM test_table;", + "len": 124, + "last": 124, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "+", + "value": "+", + "keyword": null, + "type": 2, + "flags": 1, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INTO", + "value": "INTO", + "keyword": "INTO", + "type": 1, + "flags": 3, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OUTFILE", + "value": "OUTFILE", + "keyword": "OUTFILE", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\/tmp\/result.txt'", + "value": "\/tmp\/result.txt", + "keyword": null, + "type": 7, + "flags": 1, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLUMNS", + "value": "COLUMNS", + "keyword": "COLUMNS", + "type": 1, + "flags": 1, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TERMINATED BY", + "value": "TERMINATED BY", + "keyword": "TERMINATED BY", + "type": 1, + "flags": 7, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "','", + "value": ",", + "keyword": null, + "type": 7, + "flags": 1, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OPTIONALLY", + "value": "OPTIONALLY", + "keyword": "OPTIONALLY", + "type": 1, + "flags": 3, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ENCLOSED BY", + "value": "ENCLOSED BY", + "keyword": "ENCLOSED BY", + "type": 1, + "flags": 7, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'\\\"'", + "value": "\"", + "keyword": null, + "type": 7, + "flags": 1, + "position": 99 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "test_table", + "value": "test_table", + "keyword": null, + "type": 0, + "flags": 0, + "position": 113 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 123 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "b", + "expr": "b", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a+b", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "test_table", + "column": null, + "expr": "test_table", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "FIELDS_OPTIONS": { + "TERMINATED BY": [ + 1, + "expr" + ], + "OPTIONALLY": 2, + "ENCLOSED BY": [ + 3, + "expr" + ], + "ESCAPED BY": [ + 4, + "expr" + ] + }, + "LINES_OPTIONS": { + "STARTING BY": [ + 1, + "expr" + ], + "TERMINATED BY": [ + 2, + "expr" + ] + }, + "type": "OUTFILE", + "dest": "\/tmp\/result.txt", + "columns": null, + "values": null, + "fields_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "TERMINATED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": ",", + "expr": "','", + "alias": null, + "function": null, + "subquery": null + }, + "value": "','" + }, + "2": "OPTIONALLY", + "3": { + "name": "ENCLOSED BY", + "equals": false, + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "\"", + "expr": "'\\\"'", + "alias": null, + "function": null, + "subquery": null + }, + "value": "'\\\"'" + } + } + }, + "fields_keyword": false, + "lines_options": null + }, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinCross.out b/tests/data/parser/parseSelectJoinCross.out index 5c76b0757..6686a557a 100644 --- a/tests/data/parser/parseSelectJoinCross.out +++ b/tests/data/parser/parseSelectJoinCross.out @@ -1,10 +1,981 @@ -a:4:{s:5:"query";s:110:"SELECT table112.id,table112.bval1,table112.bval2, -table111.id,table111.aval1 -FROM table112 -CROSS JOIN table111";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:110:"SELECT table112.id,table112.bval1,table112.bval2, -table111.id,table111.aval1 -FROM table112 -CROSS JOIN table111";s:3:"len";i:110;s:4:"last";i:110;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:31:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table112";s:5:"value";s:8:"table112";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table112";s:5:"value";s:8:"table112";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:27;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"bval1";s:5:"value";s:5:"bval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table112";s:5:"value";s:8:"table112";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"bval2";s:5:"value";s:5:"bval2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:43;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:48;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:58;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:61;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:62;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"aval1";s:5:"value";s:5:"aval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:71;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:77;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table112";s:5:"value";s:8:"table112";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:82;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:90;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"CROSS JOIN";s:5:"value";s:10:"CROSS JOIN";s:7:"keyword";s:10:"CROSS JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:91;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:101;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:102;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:31;s:3:"idx";i:31;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:5:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table112";s:6:"column";s:2:"id";s:4:"expr";s:11:"table112.id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table112";s:6:"column";s:5:"bval1";s:4:"expr";s:14:"table112.bval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table112";s:6:"column";s:5:"bval2";s:4:"expr";s:14:"table112.bval2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:3;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table111";s:6:"column";s:2:"id";s:4:"expr";s:11:"table111.id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:4;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table111";s:6:"column";s:5:"aval1";s:4:"expr";s:14:"table111.aval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table112";s:6:"column";N;s:4:"expr";s:8:"table112";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:5:"CROSS";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table111";s:6:"column";N;s:4:"expr";s:8:"table111";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:29;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT table112.id,table112.bval1,table112.bval2,\ntable111.id,table111.aval1\nFROM table112\nCROSS JOIN table111", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT table112.id,table112.bval1,table112.bval2,\ntable111.id,table111.aval1\nFROM table112\nCROSS JOIN table111", + "len": 110, + "last": 110, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table112", + "value": "table112", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table112", + "value": "table112", + "keyword": null, + "type": 0, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bval1", + "value": "bval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table112", + "value": "table112", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bval2", + "value": "bval2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "aval1", + "value": "aval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table112", + "value": "table112", + "keyword": null, + "type": 0, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CROSS JOIN", + "value": "CROSS JOIN", + "keyword": "CROSS JOIN", + "type": 1, + "flags": 7, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 101 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 31, + "idx": 31 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table112", + "column": "id", + "expr": "table112.id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table112", + "column": "bval1", + "expr": "table112.bval1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table112", + "column": "bval2", + "expr": "table112.bval2", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table111", + "column": "id", + "expr": "table111.id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table111", + "column": "aval1", + "expr": "table111.aval1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table112", + "column": null, + "expr": "table112", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "CROSS", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table111", + "column": null, + "expr": "table111", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 29 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinMultiple.out b/tests/data/parser/parseSelectJoinMultiple.out index 05d347774..15f5a6941 100644 --- a/tests/data/parser/parseSelectJoinMultiple.out +++ b/tests/data/parser/parseSelectJoinMultiple.out @@ -1,4 +1,900 @@ -a:4:{s:5:"query";s:92:"SELECT * FROM Orders NATURAL JOIN Items_Orders NATURAL JOIN Items -WHERE customer= 'username'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:92:"SELECT * FROM Orders NATURAL JOIN Items_Orders NATURAL JOIN Items -WHERE customer= 'username'";s:3:"len";i:92;s:4:"last";i:92;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"Orders";s:5:"value";s:6:"Orders";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"NATURAL JOIN";s:5:"value";s:12:"NATURAL JOIN";s:7:"keyword";s:12:"NATURAL JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"Items_Orders";s:5:"value";s:12:"Items_Orders";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"NATURAL JOIN";s:5:"value";s:12:"NATURAL JOIN";s:7:"keyword";s:12:"NATURAL JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:47;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"Items";s:5:"value";s:5:"Items";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:60;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:66;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:71;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"customer";s:5:"value";s:8:"customer";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:72;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:80;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"'username'";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:82;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"Orders";s:6:"column";N;s:4:"expr";s:6:"Orders";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:8:"customer";i:1;s:8:"username";}s:10:"isOperator";b:0;s:4:"expr";s:20:"customer= 'username'";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:2:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:7:"NATURAL";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:12:"Items_Orders";s:6:"column";N;s:4:"expr";s:12:"Items_Orders";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}i:1;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:7:"NATURAL";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"Items";s:6:"column";N;s:4:"expr";s:5:"Items";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM Orders NATURAL JOIN Items_Orders NATURAL JOIN Items\nWHERE customer= 'username'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM Orders NATURAL JOIN Items_Orders NATURAL JOIN Items\nWHERE customer= 'username'", + "len": 92, + "last": 92, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Orders", + "value": "Orders", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL JOIN", + "value": "NATURAL JOIN", + "keyword": "NATURAL JOIN", + "type": 1, + "flags": 7, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Items_Orders", + "value": "Items_Orders", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL JOIN", + "value": "NATURAL JOIN", + "keyword": "NATURAL JOIN", + "type": 1, + "flags": 7, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Items", + "value": "Items", + "keyword": null, + "type": 0, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "customer", + "value": "customer", + "keyword": null, + "type": 0, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'username'", + "value": "username", + "keyword": null, + "type": 7, + "flags": 1, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "Orders", + "column": null, + "expr": "Orders", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "customer", + "username" + ], + "isOperator": false, + "expr": "customer= 'username'" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "Items_Orders", + "column": null, + "expr": "Items_Orders", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "Items", + "column": null, + "expr": "Items", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinMultiple2.out b/tests/data/parser/parseSelectJoinMultiple2.out index 43c7a94d3..b8d9bf139 100644 --- a/tests/data/parser/parseSelectJoinMultiple2.out +++ b/tests/data/parser/parseSelectJoinMultiple2.out @@ -1,7 +1,1047 @@ -a:4:{s:5:"query";s:118:"SELECT * FROM orders -NATURAL JOIN Items_Orders LEFT JOIN items on orders.item_id = items.id -WHERE customer= 'username'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:118:"SELECT * FROM orders -NATURAL JOIN Items_Orders LEFT JOIN items on orders.item_id = items.id -WHERE customer= 'username'";s:3:"len";i:118;s:4:"last";i:118;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:35:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"orders";s:5:"value";s:6:"orders";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"NATURAL JOIN";s:5:"value";s:12:"NATURAL JOIN";s:7:"keyword";s:12:"NATURAL JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:21;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"Items_Orders";s:5:"value";s:12:"Items_Orders";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"LEFT JOIN";s:5:"value";s:9:"LEFT JOIN";s:7:"keyword";s:9:"LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:47;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"items";s:5:"value";s:5:"items";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:57;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:63;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:65;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"orders";s:5:"value";s:6:"orders";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:66;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:72;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"item_id";s:5:"value";s:7:"item_id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:73;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:81;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"items";s:5:"value";s:5:"items";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:83;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:88;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:89;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:92;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:97;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"customer";s:5:"value";s:8:"customer";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:98;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:106;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:107;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"'username'";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:108;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:35;s:3:"idx";i:35;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"orders";s:6:"column";N;s:4:"expr";s:6:"orders";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:8:"customer";i:1;s:8:"username";}s:10:"isOperator";b:0;s:4:"expr";s:20:"customer= 'username'";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:2:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:7:"NATURAL";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:12:"Items_Orders";s:6:"column";N;s:4:"expr";s:12:"Items_Orders";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}i:1;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"items";s:6:"column";N;s:4:"expr";s:5:"items";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:4:{i:0;s:6:"orders";i:1;s:7:"item_id";i:2;s:5:"items";i:3;s:2:"id";}s:10:"isOperator";b:0;s:4:"expr";s:25:"orders.item_id = items.id";}}s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:33;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM orders\nNATURAL JOIN Items_Orders LEFT JOIN items on orders.item_id = items.id\nWHERE customer= 'username'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM orders\nNATURAL JOIN Items_Orders LEFT JOIN items on orders.item_id = items.id\nWHERE customer= 'username'", + "len": 118, + "last": 118, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "orders", + "value": "orders", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL JOIN", + "value": "NATURAL JOIN", + "keyword": "NATURAL JOIN", + "type": 1, + "flags": 7, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Items_Orders", + "value": "Items_Orders", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEFT JOIN", + "value": "LEFT JOIN", + "keyword": "LEFT JOIN", + "type": 1, + "flags": 7, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "items", + "value": "items", + "keyword": null, + "type": 0, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "orders", + "value": "orders", + "keyword": null, + "type": 0, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "item_id", + "value": "item_id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "items", + "value": "items", + "keyword": null, + "type": 0, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "customer", + "value": "customer", + "keyword": null, + "type": 0, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 106 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'username'", + "value": "username", + "keyword": null, + "type": 7, + "flags": 1, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 35, + "idx": 35 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "orders", + "column": null, + "expr": "orders", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "customer", + "username" + ], + "isOperator": false, + "expr": "customer= 'username'" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "Items_Orders", + "column": null, + "expr": "Items_Orders", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "items", + "column": null, + "expr": "items", + "alias": null, + "function": null, + "subquery": null + }, + "on": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "orders", + "item_id", + "items", + "id" + ], + "isOperator": false, + "expr": "orders.item_id = items.id" + } + ], + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 33 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinNatural.out b/tests/data/parser/parseSelectJoinNatural.out index 5d7abc349..6bf8b30e3 100644 --- a/tests/data/parser/parseSelectJoinNatural.out +++ b/tests/data/parser/parseSelectJoinNatural.out @@ -1,7 +1,800 @@ -a:4:{s:5:"query";s:57:"SELECT id,aval1,cval1 -FROM table111 -NATURAL JOIN table113";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:57:"SELECT id,aval1,cval1 -FROM table111 -NATURAL JOIN table113";s:3:"len";i:57;s:4:"last";i:57;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:16:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"aval1";s:5:"value";s:5:"aval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"cval1";s:5:"value";s:5:"cval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"NATURAL JOIN";s:5:"value";s:12:"NATURAL JOIN";s:7:"keyword";s:12:"NATURAL JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:36;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table113";s:5:"value";s:8:"table113";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:16;s:3:"idx";i:16;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"aval1";s:4:"expr";s:5:"aval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"cval1";s:4:"expr";s:5:"cval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table111";s:6:"column";N;s:4:"expr";s:8:"table111";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:7:"NATURAL";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table113";s:6:"column";N;s:4:"expr";s:8:"table113";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:14;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT id,aval1,cval1\nFROM table111\nNATURAL JOIN table113", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT id,aval1,cval1\nFROM table111\nNATURAL JOIN table113", + "len": 57, + "last": 57, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "aval1", + "value": "aval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "cval1", + "value": "cval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL JOIN", + "value": "NATURAL JOIN", + "keyword": "NATURAL JOIN", + "type": 1, + "flags": 7, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table113", + "value": "table113", + "keyword": null, + "type": 0, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 16, + "idx": 16 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "aval1", + "expr": "aval1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "cval1", + "expr": "cval1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table111", + "column": null, + "expr": "table111", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table113", + "column": null, + "expr": "table113", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 14 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinNaturalLeft.out b/tests/data/parser/parseSelectJoinNaturalLeft.out index 0016c73ef..3121090fa 100644 --- a/tests/data/parser/parseSelectJoinNaturalLeft.out +++ b/tests/data/parser/parseSelectJoinNaturalLeft.out @@ -1,7 +1,953 @@ -a:4:{s:5:"query";s:88:"SELECT C.First_Name, C.Last_Name, O.title -FROM Employee as C -NATURAL LEFT JOIN JOb as O;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:88:"SELECT C.First_Name, C.Last_Name, O.title -FROM Employee as C -NATURAL LEFT JOIN JOb as O;";s:3:"len";i:88;s:4:"last";i:88;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"C";s:5:"value";s:1:"C";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"First_Name";s:5:"value";s:10:"First_Name";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"C";s:5:"value";s:1:"C";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"Last_Name";s:5:"value";s:9:"Last_Name";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"O";s:5:"value";s:1:"O";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:35;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"title";s:5:"value";s:5:"title";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:36;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"Employee";s:5:"value";s:8:"Employee";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:56;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"C";s:5:"value";s:1:"C";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:59;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:60;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"NATURAL LEFT JOIN";s:5:"value";s:17:"NATURAL LEFT JOIN";s:7:"keyword";s:17:"NATURAL LEFT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:61;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:78;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"JOb";s:5:"value";s:3:"JOb";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:79;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:83;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"O";s:5:"value";s:1:"O";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:87;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"C";s:6:"column";s:10:"First_Name";s:4:"expr";s:12:"C.First_Name";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"C";s:6:"column";s:9:"Last_Name";s:4:"expr";s:11:"C.Last_Name";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"O";s:6:"column";s:5:"title";s:4:"expr";s:7:"O.title";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"Employee";s:6:"column";N;s:4:"expr";s:8:"Employee";s:5:"alias";s:1:"C";s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:12:"NATURAL LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"JOb";s:6:"column";N;s:4:"expr";s:3:"JOb";s:5:"alias";s:1:"O";s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT C.First_Name, C.Last_Name, O.title\nFROM Employee as C\nNATURAL LEFT JOIN JOb as O;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT C.First_Name, C.Last_Name, O.title\nFROM Employee as C\nNATURAL LEFT JOIN JOb as O;", + "len": 88, + "last": 88, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "C", + "value": "C", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "First_Name", + "value": "First_Name", + "keyword": null, + "type": 0, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "C", + "value": "C", + "keyword": null, + "type": 0, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Last_Name", + "value": "Last_Name", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "O", + "value": "O", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "title", + "value": "title", + "keyword": null, + "type": 0, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Employee", + "value": "Employee", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "C", + "value": "C", + "keyword": null, + "type": 0, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL LEFT JOIN", + "value": "NATURAL LEFT JOIN", + "keyword": "NATURAL LEFT JOIN", + "type": 1, + "flags": 7, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 78 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "JOb", + "value": "JOb", + "keyword": null, + "type": 0, + "flags": 0, + "position": 79 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "O", + "value": "O", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "C", + "column": "First_Name", + "expr": "C.First_Name", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "C", + "column": "Last_Name", + "expr": "C.Last_Name", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "O", + "column": "title", + "expr": "O.title", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "Employee", + "column": null, + "expr": "Employee", + "alias": "C", + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "JOb", + "column": null, + "expr": "JOb", + "alias": "O", + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinNaturalLeftOuter.out b/tests/data/parser/parseSelectJoinNaturalLeftOuter.out index b3fd774f3..284936be3 100644 --- a/tests/data/parser/parseSelectJoinNaturalLeftOuter.out +++ b/tests/data/parser/parseSelectJoinNaturalLeftOuter.out @@ -1 +1,727 @@ -a:4:{s:5:"query";s:55:"SELECT * FROM actor NATURAL LEFT OUTER JOIN film_actor;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:55:"SELECT * FROM actor NATURAL LEFT OUTER JOIN film_actor;";s:3:"len";i:55;s:4:"last";i:55;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"actor";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:23:"NATURAL LEFT OUTER JOIN";s:5:"value";s:23:"NATURAL LEFT OUTER JOIN";s:7:"keyword";s:23:"NATURAL LEFT OUTER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"film_actor";s:5:"value";s:10:"film_actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:44;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:54;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:5:"actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:18:"NATURAL LEFT OUTER";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"film_actor";s:6:"column";N;s:4:"expr";s:10:"film_actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM actor NATURAL LEFT OUTER JOIN film_actor;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM actor NATURAL LEFT OUTER JOIN film_actor;", + "len": 55, + "last": 55, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "actor", + "value": "actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL LEFT OUTER JOIN", + "value": "NATURAL LEFT OUTER JOIN", + "keyword": "NATURAL LEFT OUTER JOIN", + "type": 1, + "flags": 7, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "film_actor", + "value": "film_actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "actor", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL LEFT OUTER", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "film_actor", + "column": null, + "expr": "film_actor", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinNaturalRight.out b/tests/data/parser/parseSelectJoinNaturalRight.out index 65cdcd8bd..11a469224 100644 --- a/tests/data/parser/parseSelectJoinNaturalRight.out +++ b/tests/data/parser/parseSelectJoinNaturalRight.out @@ -1,4 +1,736 @@ -a:4:{s:5:"query";s:51:"SELECT * FROM actor NATURAL RIGHT JOIN film_actor; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:51:"SELECT * FROM actor NATURAL RIGHT JOIN film_actor; -";s:3:"len";i:51;s:4:"last";i:51;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:14:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"actor";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:18:"NATURAL RIGHT JOIN";s:5:"value";s:18:"NATURAL RIGHT JOIN";s:7:"keyword";s:18:"NATURAL RIGHT JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"film_actor";s:5:"value";s:10:"film_actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:49;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:14;s:3:"idx";i:14;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:5:"actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:13:"NATURAL RIGHT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"film_actor";s:6:"column";N;s:4:"expr";s:10:"film_actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM actor NATURAL RIGHT JOIN film_actor;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM actor NATURAL RIGHT JOIN film_actor;\n", + "len": 51, + "last": 51, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "actor", + "value": "actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL RIGHT JOIN", + "value": "NATURAL RIGHT JOIN", + "keyword": "NATURAL RIGHT JOIN", + "type": 1, + "flags": 7, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "film_actor", + "value": "film_actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 14, + "idx": 14 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "actor", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL RIGHT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "film_actor", + "column": null, + "expr": "film_actor", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinNaturalRightOuter.out b/tests/data/parser/parseSelectJoinNaturalRightOuter.out index 1855a0298..c32cc537b 100644 --- a/tests/data/parser/parseSelectJoinNaturalRightOuter.out +++ b/tests/data/parser/parseSelectJoinNaturalRightOuter.out @@ -1 +1,727 @@ -a:4:{s:5:"query";s:56:"SELECT * FROM actor NATURAL RIGHT OUTER JOIN film_actor;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:56:"SELECT * FROM actor NATURAL RIGHT OUTER JOIN film_actor;";s:3:"len";i:56;s:4:"last";i:56;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:13:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"actor";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:24:"NATURAL RIGHT OUTER JOIN";s:5:"value";s:24:"NATURAL RIGHT OUTER JOIN";s:7:"keyword";s:24:"NATURAL RIGHT OUTER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"film_actor";s:5:"value";s:10:"film_actor";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:55;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:13;s:3:"idx";i:13;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:5:"actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:19:"NATURAL RIGHT OUTER";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:10:"film_actor";s:6:"column";N;s:4:"expr";s:10:"film_actor";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT * FROM actor NATURAL RIGHT OUTER JOIN film_actor;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT * FROM actor NATURAL RIGHT OUTER JOIN film_actor;", + "len": 56, + "last": 56, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "actor", + "value": "actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NATURAL RIGHT OUTER JOIN", + "value": "NATURAL RIGHT OUTER JOIN", + "keyword": "NATURAL RIGHT OUTER JOIN", + "type": 1, + "flags": 7, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "film_actor", + "value": "film_actor", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 13, + "idx": 13 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "actor", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "NATURAL RIGHT OUTER", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "film_actor", + "column": null, + "expr": "film_actor", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectJoinStraight.out b/tests/data/parser/parseSelectJoinStraight.out index 2f4833e14..9e3606680 100644 --- a/tests/data/parser/parseSelectJoinStraight.out +++ b/tests/data/parser/parseSelectJoinStraight.out @@ -1,7 +1,947 @@ -a:4:{s:5:"query";s:85:"SELECT id,aval1,cval1 -FROM table111 -STRAIGHT_JOIN table113 on table111.a = table113.b";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:85:"SELECT id,aval1,cval1 -FROM table111 -STRAIGHT_JOIN table113 on table111.a = table113.b";s:3:"len";i:85;s:4:"last";i:85;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:28:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"aval1";s:5:"value";s:5:"aval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"cval1";s:5:"value";s:5:"cval1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:16;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:27;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"STRAIGHT_JOIN";s:5:"value";s:13:"STRAIGHT_JOIN";s:7:"keyword";s:13:"STRAIGHT_JOIN";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:36;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:49;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table113";s:5:"value";s:8:"table113";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:50;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:58;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"on";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:59;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table111";s:5:"value";s:8:"table111";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:62;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:70;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:71;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:73;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"table113";s:5:"value";s:8:"table113";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"b";s:5:"value";s:1:"b";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:84;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:28;s:3:"idx";i:28;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:3:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:2:"id";s:4:"expr";s:2:"id";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"aval1";s:4:"expr";s:5:"aval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:2;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"cval1";s:4:"expr";s:5:"cval1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table111";s:6:"column";N;s:4:"expr";s:8:"table111";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:8:"STRAIGHT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:8:"table113";s:6:"column";N;s:4:"expr";s:8:"table113";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:4:{i:0;s:8:"table111";i:1;s:1:"a";i:2;s:8:"table113";i:3;s:1:"b";}s:10:"isOperator";b:0;s:4:"expr";s:23:"table111.a = table113.b";}}s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:26;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT id,aval1,cval1\nFROM table111\nSTRAIGHT_JOIN table113 on table111.a = table113.b", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT id,aval1,cval1\nFROM table111\nSTRAIGHT_JOIN table113 on table111.a = table113.b", + "len": 85, + "last": 85, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "aval1", + "value": "aval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "cval1", + "value": "cval1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "STRAIGHT_JOIN", + "value": "STRAIGHT_JOIN", + "keyword": "STRAIGHT_JOIN", + "type": 1, + "flags": 3, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table113", + "value": "table113", + "keyword": null, + "type": 0, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "on", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table111", + "value": "table111", + "keyword": null, + "type": 0, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 71 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table113", + "value": "table113", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "b", + "value": "b", + "keyword": null, + "type": 0, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 28, + "idx": 28 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "id", + "expr": "id", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "aval1", + "expr": "aval1", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "cval1", + "expr": "cval1", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table111", + "column": null, + "expr": "table111", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "STRAIGHT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table113", + "column": null, + "expr": "table113", + "alias": null, + "function": null, + "subquery": null + }, + "on": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "table111", + "a", + "table113", + "b" + ], + "isOperator": false, + "expr": "table111.a = table113.b" + } + ], + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 26 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectNested.out b/tests/data/parser/parseSelectNested.out index 33771fcc2..5c22106e3 100644 --- a/tests/data/parser/parseSelectNested.out +++ b/tests/data/parser/parseSelectNested.out @@ -1 +1,778 @@ -a:4:{s:5:"query";s:52:"SELECT (SELECT 'foo') as Bar, (SELECT 'baz') as fOo;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:52:"SELECT (SELECT 'foo') as Bar, (SELECT 'baz') as fOo;";s:3:"len";i:52;s:4:"last";i:52;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:24:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'foo'";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:15;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:20;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:21;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"Bar";s:5:"value";s:3:"Bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:28;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:29;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:30;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:31;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"'baz'";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:38;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:43;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:44;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"as";s:5:"value";s:2:"AS";s:7:"keyword";s:2:"AS";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:45;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"fOo";s:5:"value";s:3:"fOo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:51;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:24;s:3:"idx";i:24;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:14:"(SELECT 'foo')";s:5:"alias";s:3:"Bar";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:14:"(SELECT 'baz')";s:5:"alias";s:3:"fOo";s:8:"function";N;s:8:"subquery";s:6:"SELECT";}}s:4:"from";a:0:{}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SELECT (SELECT 'foo') as Bar, (SELECT 'baz') as fOo;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT (SELECT 'foo') as Bar, (SELECT 'baz') as fOo;", + "len": 52, + "last": 52, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'foo'", + "value": "foo", + "keyword": null, + "type": 7, + "flags": 1, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "Bar", + "value": "Bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 29 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'baz'", + "value": "baz", + "keyword": null, + "type": 7, + "flags": 1, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "as", + "value": "AS", + "keyword": "AS", + "type": 1, + "flags": 3, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "fOo", + "value": "fOo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 24, + "idx": 24 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT 'foo')", + "alias": "Bar", + "function": null, + "subquery": "SELECT" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "(SELECT 'baz')", + "alias": "fOo", + "function": null, + "subquery": "SELECT" + } + ], + "from": [], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectUnion.out b/tests/data/parser/parseSelectUnion.out index ab1675dcc..19da6afe7 100644 --- a/tests/data/parser/parseSelectUnion.out +++ b/tests/data/parser/parseSelectUnion.out @@ -1,4 +1,1172 @@ -a:4:{s:5:"query";s:62:"(SELECT a FROM t WHERE a=1) UNION (SELECT a FROM t WHERE a=2) -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:62:"(SELECT a FROM t WHERE a=1) UNION (SELECT a FROM t WHERE a=2) -";s:3:"len";i:62;s:4:"last";i:62;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:35:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:10;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:24;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:25;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:26;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UNION";s:5:"value";s:5:"UNION";s:7:"keyword";s:5:"UNION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:28;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:34;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:35;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:42;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:44;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:48;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"t";s:5:"value";s:1:"t";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:49;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:51;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"a";s:5:"value";s:1:"a";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:57;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:58;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:59;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:60;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:61;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:35;s:3:"idx";i:35;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"t";s:6:"column";N;s:4:"expr";s:1:"t";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:1:"a";}s:10:"isOperator";b:0;s:4:"expr";s:3:"a=1";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:1:{i:0;a:2:{i:0;s:5:"UNION";i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:1:"a";s:4:"expr";s:1:"a";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:1:"t";s:6:"column";N;s:4:"expr";s:1:"t";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:1:"a";}s:10:"isOperator";b:0;s:4:"expr";s:3:"a=2";}}s:5:"group";N;s:6:"having";N;s:5:"order";a:0:{}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:16;s:4:"last";i:33;}}}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:33;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "(SELECT a FROM t WHERE a=1) UNION (SELECT a FROM t WHERE a=2)\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "(SELECT a FROM t WHERE a=1) UNION (SELECT a FROM t WHERE a=2)\n", + "len": 62, + "last": 62, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNION", + "value": "UNION", + "keyword": "UNION", + "type": 1, + "flags": 3, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "t", + "value": "t", + "keyword": null, + "type": 0, + "flags": 0, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "a", + "value": "a", + "keyword": null, + "type": 0, + "flags": 0, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 58 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 35, + "idx": 35 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t", + "column": null, + "expr": "t", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "a" + ], + "isOperator": false, + "expr": "a=1" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [ + [ + "UNION", + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "a", + "expr": "a", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "t", + "column": null, + "expr": "t", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "a" + ], + "isOperator": false, + "expr": "a=2" + } + ], + "group": null, + "having": null, + "order": [], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 16, + "last": 33 + } + ] + ], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 33 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectUnion2.out b/tests/data/parser/parseSelectUnion2.out index fa38a7695..c27120653 100644 --- a/tests/data/parser/parseSelectUnion2.out +++ b/tests/data/parser/parseSelectUnion2.out @@ -1 +1,2609 @@ -a:4:{s:5:"query";s:344:"(SELECT DISTINCT `User`, `Host` FROM `mysql`.`user` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`db` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`tables_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`columns_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`procs_priv` ) ORDER BY `User` ASC, `Host` ASC";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:344:"(SELECT DISTINCT `User`, `Host` FROM `mysql`.`user` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`db` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`tables_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`columns_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`procs_priv` ) ORDER BY `User` ASC, `Host` ASC";s:3:"len";i:344;s:4:"last";i:344;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:109:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`mysql`";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:37;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:44;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`user`";s:5:"value";s:4:"user";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:45;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:52;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UNION";s:5:"value";s:5:"UNION";s:7:"keyword";s:5:"UNION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:60;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:61;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:68;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:76;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:77;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:83;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:85;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:91;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:92;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`mysql`";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:97;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:104;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"`db`";s:5:"value";s:2:"db";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:105;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:109;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:110;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:111;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UNION";s:5:"value";s:5:"UNION";s:7:"keyword";s:5:"UNION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:112;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:117;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:118;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:119;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:125;}i:43;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:126;}i:44;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:134;}i:45;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:135;}i:46;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:141;}i:47;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:142;}i:48;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:143;}i:49;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:149;}i:50;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:150;}i:51;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:154;}i:52;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`mysql`";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:155;}i:53;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:162;}i:54;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"`tables_priv`";s:5:"value";s:11:"tables_priv";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:163;}i:55;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:176;}i:56;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:177;}i:57;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:178;}i:58;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UNION";s:5:"value";s:5:"UNION";s:7:"keyword";s:5:"UNION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:179;}i:59;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:184;}i:60;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:185;}i:61;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:186;}i:62;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:192;}i:63;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:193;}i:64;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:201;}i:65;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:202;}i:66;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:208;}i:67;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:209;}i:68;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:210;}i:69;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:216;}i:70;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:217;}i:71;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:221;}i:72;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`mysql`";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:222;}i:73;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:229;}i:74;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:14:"`columns_priv`";s:5:"value";s:12:"columns_priv";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:230;}i:75;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:244;}i:76;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:245;}i:77;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:246;}i:78;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"UNION";s:5:"value";s:5:"UNION";s:7:"keyword";s:5:"UNION";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:247;}i:79;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:252;}i:80;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:253;}i:81;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:254;}i:82;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:260;}i:83;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:261;}i:84;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:269;}i:85;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:270;}i:86;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:276;}i:87;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:277;}i:88;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:278;}i:89;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:284;}i:90;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:285;}i:91;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:289;}i:92;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`mysql`";s:5:"value";s:5:"mysql";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:290;}i:93;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:".";s:5:"value";s:1:".";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:297;}i:94;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:12:"`procs_priv`";s:5:"value";s:10:"procs_priv";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:298;}i:95;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:310;}i:96;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:311;}i:97;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:312;}i:98;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ORDER BY";s:5:"value";s:8:"ORDER BY";s:7:"keyword";s:8:"ORDER BY";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:313;}i:99;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:321;}i:100;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`User`";s:5:"value";s:4:"User";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:322;}i:101;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:328;}i:102;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:329;}i:103;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:332;}i:104;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:333;}i:105;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"`Host`";s:5:"value";s:4:"Host";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:334;}i:106;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:340;}i:107;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"ASC";s:5:"value";s:3:"ASC";s:7:"keyword";s:3:"ASC";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:341;}i:108;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:109;s:3:"idx";i:109;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:5:"mysql";s:5:"table";s:4:"user";s:6:"column";N;s:4:"expr";s:14:"`mysql`.`user`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\OrderKeyword":2:{s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:4:"type";s:3:"ASC";}}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:4:{i:0;a:2:{i:0;s:5:"UNION";i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:5:"mysql";s:5:"table";s:2:"db";s:6:"column";N;s:4:"expr";s:12:"`mysql`.`db`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";a:0:{}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:18;s:4:"last";i:37;}}i:1;a:2:{i:0;s:5:"UNION";i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:5:"mysql";s:5:"table";s:11:"tables_priv";s:6:"column";N;s:4:"expr";s:21:"`mysql`.`tables_priv`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";a:0:{}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:38;s:4:"last";i:57;}}i:2;a:2:{i:0;s:5:"UNION";i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:5:"mysql";s:5:"table";s:12:"columns_priv";s:6:"column";N;s:4:"expr";s:22:"`mysql`.`columns_priv`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";a:0:{}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:58;s:4:"last";i:77;}}i:3;a:2:{i:0;s:5:"UNION";i:1;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"User";s:4:"expr";s:6:"`User`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:4:"Host";s:4:"expr";s:6:"`Host`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";s:5:"mysql";s:5:"table";s:10:"procs_priv";s:6:"column";N;s:4:"expr";s:20:"`mysql`.`procs_priv`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";a:0:{}s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:78;s:4:"last";i:107;}}}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:0;s:4:"last";i:107;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "(SELECT DISTINCT `User`, `Host` FROM `mysql`.`user` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`db` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`tables_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`columns_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`procs_priv` ) ORDER BY `User` ASC, `Host` ASC", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "(SELECT DISTINCT `User`, `Host` FROM `mysql`.`user` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`db` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`tables_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`columns_priv` ) UNION (SELECT DISTINCT `User`, `Host` FROM `mysql`.`procs_priv` ) ORDER BY `User` ASC, `Host` ASC", + "len": 344, + "last": 344, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mysql`", + "value": "mysql", + "keyword": null, + "type": 8, + "flags": 2, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`user`", + "value": "user", + "keyword": null, + "type": 8, + "flags": 2, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNION", + "value": "UNION", + "keyword": "UNION", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 76 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 77 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 91 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 92 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mysql`", + "value": "mysql", + "keyword": null, + "type": 8, + "flags": 2, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 104 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`db`", + "value": "db", + "keyword": null, + "type": 8, + "flags": 2, + "position": 105 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNION", + "value": "UNION", + "keyword": "UNION", + "type": 1, + "flags": 3, + "position": 112 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 118 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 125 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 126 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 134 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 135 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 141 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 142 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 143 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 149 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 150 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 154 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mysql`", + "value": "mysql", + "keyword": null, + "type": 8, + "flags": 2, + "position": 155 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 162 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tables_priv`", + "value": "tables_priv", + "keyword": null, + "type": 8, + "flags": 2, + "position": 163 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 176 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 177 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 178 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNION", + "value": "UNION", + "keyword": "UNION", + "type": 1, + "flags": 3, + "position": 179 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 184 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 185 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 186 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 192 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 193 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 201 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 202 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 208 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 209 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 210 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 216 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 217 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 221 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mysql`", + "value": "mysql", + "keyword": null, + "type": 8, + "flags": 2, + "position": 222 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 229 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`columns_priv`", + "value": "columns_priv", + "keyword": null, + "type": 8, + "flags": 2, + "position": 230 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 244 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 245 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 246 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNION", + "value": "UNION", + "keyword": "UNION", + "type": 1, + "flags": 3, + "position": 247 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 252 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 253 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 254 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 260 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 261 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 269 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 270 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 276 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 277 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 278 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 284 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 285 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 289 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`mysql`", + "value": "mysql", + "keyword": null, + "type": 8, + "flags": 2, + "position": 290 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ".", + "value": ".", + "keyword": null, + "type": 2, + "flags": 16, + "position": 297 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`procs_priv`", + "value": "procs_priv", + "keyword": null, + "type": 8, + "flags": 2, + "position": 298 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 310 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 311 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 312 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ORDER BY", + "value": "ORDER BY", + "keyword": "ORDER BY", + "type": 1, + "flags": 7, + "position": 313 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 321 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`User`", + "value": "User", + "keyword": null, + "type": 8, + "flags": 2, + "position": 322 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 328 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 329 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 332 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 333 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`Host`", + "value": "Host", + "keyword": null, + "type": 8, + "flags": 2, + "position": 334 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 340 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ASC", + "value": "ASC", + "keyword": "ASC", + "type": 1, + "flags": 3, + "position": 341 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 109, + "idx": 109 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "mysql", + "table": "user", + "column": null, + "expr": "`mysql`.`user`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + }, + "type": "ASC" + } + ], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [ + [ + "UNION", + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "mysql", + "table": "db", + "column": null, + "expr": "`mysql`.`db`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": [], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 18, + "last": 37 + } + ], + [ + "UNION", + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "mysql", + "table": "tables_priv", + "column": null, + "expr": "`mysql`.`tables_priv`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": [], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 38, + "last": 57 + } + ], + [ + "UNION", + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "mysql", + "table": "columns_priv", + "column": null, + "expr": "`mysql`.`columns_priv`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": [], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 58, + "last": 77 + } + ], + [ + "UNION", + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "User", + "expr": "`User`", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "Host", + "expr": "`Host`", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": "mysql", + "table": "procs_priv", + "column": null, + "expr": "`mysql`.`procs_priv`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": [], + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 78, + "last": 107 + } + ] + ], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 0, + "last": 107 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectWithParenthesis.out b/tests/data/parser/parseSelectWithParenthesis.out index 79e984d21..632db91f1 100644 --- a/tests/data/parser/parseSelectWithParenthesis.out +++ b/tests/data/parser/parseSelectWithParenthesis.out @@ -1 +1,720 @@ -a:4:{s:5:"query";s:43:"(SELECT first_name FROM `actor` LIMIT 1, 2)";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:43:"(SELECT first_name FROM `actor` LIMIT 1, 2)";s:3:"len";i:43;s:4:"last";i:43;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:17:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:1;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"first_name";s:5:"value";s:10:"first_name";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:8;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:23;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"`actor`";s:5:"value";s:5:"actor";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:32;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:37;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:38;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:39;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:17;s:3:"idx";i:17;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:10:"first_name";s:4:"expr";s:10:"first_name";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"actor";s:6:"column";N;s:4:"expr";s:7:"`actor`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:1;s:8:"rowCount";i:2;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "(SELECT first_name FROM `actor` LIMIT 1, 2)", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "(SELECT first_name FROM `actor` LIMIT 1, 2)", + "len": 43, + "last": 43, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 1 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "first_name", + "value": "first_name", + "keyword": null, + "type": 0, + "flags": 0, + "position": 8 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`actor`", + "value": "actor", + "keyword": null, + "type": 8, + "flags": 2, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 17, + "idx": 17 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "first_name", + "expr": "first_name", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "actor", + "column": null, + "expr": "`actor`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 1, + "rowCount": 2 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectWrongOrder.out b/tests/data/parser/parseSelectWrongOrder.out index 4dfcb403b..55fdabd0c 100644 --- a/tests/data/parser/parseSelectWrongOrder.out +++ b/tests/data/parser/parseSelectWrongOrder.out @@ -1 +1,841 @@ -a:4:{s:5:"query";s:56:"SELECT pid, name2 FROM tablename LIMIT 10 WHERE pid = 20";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:56:"SELECT pid, name2 FROM tablename LIMIT 10 WHERE pid = 20";s:3:"len";i:56;s:4:"last";i:56;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:23:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"name2";s:5:"value";s:5:"name2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:12;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:9:"tablename";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"10";s:5:"value";i:10;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:39;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"pid";s:5:"value";s:3:"pid";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:48;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:51;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:52;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"20";s:5:"value";i:20;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:54;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:23;s:3:"idx";i:23;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:2:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:3:"pid";s:4:"expr";s:3:"pid";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}i:1;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";s:5:"name2";s:4:"expr";s:5:"name2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tablename";s:6:"column";N;s:4:"expr";s:9:"tablename";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:3:"pid";}s:10:"isOperator";b:0;s:4:"expr";s:8:"pid = 20";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:0;s:8:"rowCount";i:10;}s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:21;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:31:"Unexpected ordering of clauses.";i:1;r:86;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT pid, name2 FROM tablename LIMIT 10 WHERE pid = 20", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT pid, name2 FROM tablename LIMIT 10 WHERE pid = 20", + "len": 56, + "last": 56, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "name2", + "value": "name2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tablename", + "value": "tablename", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "10", + "value": 10, + "keyword": null, + "type": 6, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "pid", + "value": "pid", + "keyword": null, + "type": 0, + "flags": 0, + "position": 48 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "20", + "value": 20, + "keyword": null, + "type": 6, + "flags": 0, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 23, + "idx": 23 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "pid", + "expr": "pid", + "alias": null, + "function": null, + "subquery": null + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": "name2", + "expr": "name2", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tablename", + "column": null, + "expr": "tablename", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "pid" + ], + "isOperator": false, + "expr": "pid = 20" + } + ], + "group": null, + "having": null, + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 0, + "rowCount": 10 + }, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 21 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected ordering of clauses.", + { + "@type": "@13" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSelectWrongOrder2.out b/tests/data/parser/parseSelectWrongOrder2.out index 7c2086910..b906fdfcb 100644 --- a/tests/data/parser/parseSelectWrongOrder2.out +++ b/tests/data/parser/parseSelectWrongOrder2.out @@ -1 +1,951 @@ -a:4:{s:5:"query";s:86:"SELECT DISTINCT * FROM tbl1 INNER JOIN tbl2 ON id1 = id2 WHERE 1=1 LEFT OUTER JOIN l3;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:86:"SELECT DISTINCT * FROM tbl1 INNER JOIN tbl2 ON id1 = id2 WHERE 1=1 LEFT OUTER JOIN l3;";s:3:"len";i:86;s:4:"last";i:86;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:33:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"DISTINCT";s:5:"value";s:8:"DISTINCT";s:7:"keyword";s:8:"DISTINCT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:16;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:18;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:22;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"tbl1";s:5:"value";s:4:"tbl1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:23;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:10:"INNER JOIN";s:5:"value";s:10:"INNER JOIN";s:7:"keyword";s:10:"INNER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:28;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:38;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"tbl2";s:5:"value";s:4:"tbl2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:39;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:43;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"ON";s:5:"value";s:2:"ON";s:7:"keyword";s:2:"ON";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:44;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"id1";s:5:"value";s:3:"id1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:50;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:51;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:52;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"id2";s:5:"value";s:3:"id2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:53;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:56;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:57;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:63;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:65;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:66;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:15:"LEFT OUTER JOIN";s:5:"value";s:15:"LEFT OUTER JOIN";s:7:"keyword";s:15:"LEFT OUTER JOIN";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:67;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"l3";s:5:"value";s:2:"l3";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:83;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:85;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:33;s:3:"idx";i:33;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:4:"tbl1";s:6:"column";N;s:4:"expr";s:4:"tbl1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:3:"1=1";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";a:1:{i:0;O:43:"PhpMyAdmin\SqlParser\Components\JoinKeyword":4:{s:4:"type";s:4:"LEFT";s:4:"expr";O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:2:"l3";s:6:"column";N;s:4:"expr";s:2:"l3";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}s:2:"on";N;s:5:"using";N;}}s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"DISTINCT";}}s:5:"first";i:0;s:4:"last";i:30;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:31:"Unexpected ordering of clauses.";i:1;r:163;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SELECT DISTINCT * FROM tbl1 INNER JOIN tbl2 ON id1 = id2 WHERE 1=1 LEFT OUTER JOIN l3;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SELECT DISTINCT * FROM tbl1 INNER JOIN tbl2 ON id1 = id2 WHERE 1=1 LEFT OUTER JOIN l3;", + "len": 86, + "last": 86, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DISTINCT", + "value": "DISTINCT", + "keyword": "DISTINCT", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl1", + "value": "tbl1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 23 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "INNER JOIN", + "value": "INNER JOIN", + "keyword": "INNER JOIN", + "type": 1, + "flags": 7, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 38 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "tbl2", + "value": "tbl2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 43 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ON", + "value": "ON", + "keyword": "ON", + "type": 1, + "flags": 3, + "position": 44 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id1", + "value": "id1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 51 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 52 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id2", + "value": "id2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 57 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 63 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LEFT OUTER JOIN", + "value": "LEFT OUTER JOIN", + "keyword": "LEFT OUTER JOIN", + "type": 1, + "flags": 7, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "l3", + "value": "l3", + "keyword": null, + "type": 0, + "flags": 0, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 33, + "idx": 33 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tbl1", + "column": null, + "expr": "tbl1", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1=1" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "JOINS": { + "CROSS JOIN": "CROSS", + "FULL JOIN": "FULL", + "FULL OUTER JOIN": "FULL", + "INNER JOIN": "INNER", + "JOIN": "JOIN", + "LEFT JOIN": "LEFT", + "LEFT OUTER JOIN": "LEFT", + "RIGHT JOIN": "RIGHT", + "RIGHT OUTER JOIN": "RIGHT", + "NATURAL JOIN": "NATURAL", + "NATURAL LEFT JOIN": "NATURAL LEFT", + "NATURAL RIGHT JOIN": "NATURAL RIGHT", + "NATURAL LEFT OUTER JOIN": "NATURAL LEFT OUTER", + "NATURAL RIGHT OUTER JOIN": "NATURAL RIGHT OUTER", + "STRAIGHT_JOIN": "STRAIGHT" + }, + "type": "LEFT", + "expr": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "l3", + "column": null, + "expr": "l3", + "alias": null, + "function": null, + "subquery": null + }, + "on": null, + "using": null + } + ], + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DISTINCT" + } + }, + "first": 0, + "last": 30 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected ordering of clauses.", + { + "@type": "@24" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetCharacterSet.out b/tests/data/parser/parseSetCharacterSet.out index 98ac17c19..13398956f 100644 --- a/tests/data/parser/parseSetCharacterSet.out +++ b/tests/data/parser/parseSetCharacterSet.out @@ -1 +1,460 @@ -a:4:{s:5:"query";s:24:"SET CHARACTER SET 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:24:"SET CHARACTER SET 'utf8'";s:3:"len";i:24;s:4:"last";i:24;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:18;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:13:"CHARACTER SET";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET CHARACTER SET 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET CHARACTER SET 'utf8'", + "len": 24, + "last": 24, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "CHARACTER SET", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetCharacterSetError.out b/tests/data/parser/parseSetCharacterSetError.out index 505aa55d7..464ddeb06 100644 --- a/tests/data/parser/parseSetCharacterSetError.out +++ b/tests/data/parser/parseSetCharacterSetError.out @@ -1 +1,459 @@ -a:4:{s:5:"query";s:18:"SET CHARACTER SET ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"SET CHARACTER SET ";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:17;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:13:"CHARACTER SET";s:6:"equals";b:0;s:4:"expr";s:0:"";s:5:"value";s:0:"";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:59:"Value/Expression for the option CHARACTER SET was expected.";i:1;r:30;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET CHARACTER SET ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET CHARACTER SET ", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "CHARACTER SET", + "equals": false, + "expr": "", + "value": "" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Value\/Expression for the option CHARACTER SET was expected.", + { + "@type": "@5" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetCharset.out b/tests/data/parser/parseSetCharset.out index 442cf0f40..fc0705bc4 100644 --- a/tests/data/parser/parseSetCharset.out +++ b/tests/data/parser/parseSetCharset.out @@ -1 +1,460 @@ -a:4:{s:5:"query";s:18:"SET CHARSET 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"SET CHARSET 'utf8'";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CHARSET";s:5:"value";s:7:"CHARSET";s:7:"keyword";s:7:"CHARSET";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:7:"CHARSET";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET CHARSET 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET CHARSET 'utf8'", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARSET", + "value": "CHARSET", + "keyword": "CHARSET", + "type": 1, + "flags": 33, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "CHARSET", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetCharsetError.out b/tests/data/parser/parseSetCharsetError.out index fd4e103bc..2fec929f7 100644 --- a/tests/data/parser/parseSetCharsetError.out +++ b/tests/data/parser/parseSetCharsetError.out @@ -1 +1,459 @@ -a:4:{s:5:"query";s:12:"SET CHARSET ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:12:"SET CHARSET ";s:3:"len";i:12;s:4:"last";i:12;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CHARSET";s:5:"value";s:7:"CHARSET";s:7:"keyword";s:7:"CHARSET";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:7:"CHARSET";s:6:"equals";b:0;s:4:"expr";s:0:"";s:5:"value";s:0:"";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:53:"Value/Expression for the option CHARSET was expected.";i:1;r:30;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET CHARSET ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET CHARSET ", + "len": 12, + "last": 12, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARSET", + "value": "CHARSET", + "keyword": "CHARSET", + "type": 1, + "flags": 33, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "CHARSET", + "equals": false, + "expr": "", + "value": "" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Value\/Expression for the option CHARSET was expected.", + { + "@type": "@5" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetError1.out b/tests/data/parser/parseSetError1.out index e9c2fd66c..896dbc14c 100644 --- a/tests/data/parser/parseSetError1.out +++ b/tests/data/parser/parseSetError1.out @@ -1 +1,510 @@ -a:4:{s:5:"query";s:39:"SET CHARSET 'utf8' CHARACTER SET 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:39:"SET CHARSET 'utf8' CHARACTER SET 'utf8'";s:3:"len";i:39;s:4:"last";i:39;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"CHARSET";s:5:"value";s:7:"CHARSET";s:7:"keyword";s:7:"CHARSET";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:11;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:12;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:13:"CHARACTER SET";s:5:"value";s:13:"CHARACTER SET";s:7:"keyword";s:13:"CHARACTER SET";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:19;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:2:{i:3;a:4:{s:4:"name";s:7:"CHARSET";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}i:13;a:4:{s:4:"name";s:13:"CHARACTER SET";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:37:"This option conflicts with "CHARSET".";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET CHARSET 'utf8' CHARACTER SET 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET CHARSET 'utf8' CHARACTER SET 'utf8'", + "len": 39, + "last": 39, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARSET", + "value": "CHARSET", + "keyword": "CHARSET", + "type": 1, + "flags": 33, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 12 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "CHARACTER SET", + "value": "CHARACTER SET", + "keyword": "CHARACTER SET", + "type": 1, + "flags": 7, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "CHARSET", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + }, + "13": { + "name": "CHARACTER SET", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "This option conflicts with \"CHARSET\".", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNames.out b/tests/data/parser/parseSetNames.out index c528104b5..d88fdfbd7 100644 --- a/tests/data/parser/parseSetNames.out +++ b/tests/data/parser/parseSetNames.out @@ -1 +1,460 @@ -a:4:{s:5:"query";s:16:"SET NAMES 'utf8'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:16:"SET NAMES 'utf8'";s:3:"len";i:16;s:4:"last";i:16;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:6:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:6;s:3:"idx";i:6;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET NAMES 'utf8'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES 'utf8'", + "len": 16, + "last": 16, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 6, + "idx": 6 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNames2.out b/tests/data/parser/parseSetNames2.out index aaa25051d..78ca37959 100644 --- a/tests/data/parser/parseSetNames2.out +++ b/tests/data/parser/parseSetNames2.out @@ -1 +1,506 @@ -a:4:{s:5:"query";s:42:"SET NAMES 'utf8' COLLATE 'utf8_general_ci'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:42:"SET NAMES 'utf8' COLLATE 'utf8_general_ci'";s:3:"len";i:42;s:4:"last";i:42;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLLATE";s:5:"value";s:7:"COLLATE";s:7:"keyword";s:7:"COLLATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'utf8_general_ci'";s:5:"value";s:15:"utf8_general_ci";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:7:"COLLATE";s:6:"equals";b:0;s:4:"expr";s:17:"'utf8_general_ci'";s:5:"value";s:15:"utf8_general_ci";}}}s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET NAMES 'utf8' COLLATE 'utf8_general_ci'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES 'utf8' COLLATE 'utf8_general_ci'", + "len": 42, + "last": 42, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLLATE", + "value": "COLLATE", + "keyword": "COLLATE", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8_general_ci'", + "value": "utf8_general_ci", + "keyword": null, + "type": 7, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "COLLATE", + "equals": false, + "expr": "'utf8_general_ci'", + "value": "utf8_general_ci" + } + } + }, + "set": [], + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNames3.out b/tests/data/parser/parseSetNames3.out index 60e5c90db..73ca1adad 100644 --- a/tests/data/parser/parseSetNames3.out +++ b/tests/data/parser/parseSetNames3.out @@ -1 +1,492 @@ -a:4:{s:5:"query";s:25:"SET NAMES 'utf8' DEFAULT;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:25:"SET NAMES 'utf8' DEFAULT;";s:3:"len";i:25;s:4:"last";i:25;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:9:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:9;s:3:"idx";i:9;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:7:"DEFAULT";}}s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "SET NAMES 'utf8' DEFAULT;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES 'utf8' DEFAULT;", + "len": 25, + "last": 25, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 9, + "idx": 9 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DEFAULT" + } + }, + "set": [], + "first": 0, + "last": 6 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNamesError.out b/tests/data/parser/parseSetNamesError.out index 28d443bd7..3bc54f096 100644 --- a/tests/data/parser/parseSetNamesError.out +++ b/tests/data/parser/parseSetNamesError.out @@ -1 +1,459 @@ -a:4:{s:5:"query";s:10:"SET NAMES ";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:10:"SET NAMES ";s:3:"len";i:10;s:4:"last";i:10;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:0:"";s:5:"value";s:0:"";}}}s:11:"end_options";N;s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:51:"Value/Expression for the option NAMES was expected.";i:1;r:30;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET NAMES ", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES ", + "len": 10, + "last": 10, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "", + "value": "" + } + } + }, + "end_options": null, + "set": [], + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Value\/Expression for the option NAMES was expected.", + { + "@type": "@5" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNamesError2.out b/tests/data/parser/parseSetNamesError2.out index c4d6c74b5..c30e7e633 100644 --- a/tests/data/parser/parseSetNamesError2.out +++ b/tests/data/parser/parseSetNamesError2.out @@ -1 +1,509 @@ -a:4:{s:5:"query";s:42:"SET NAMES 'utf8' DEFAULT 'utf8_general_ci'";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:42:"SET NAMES 'utf8' DEFAULT 'utf8_general_ci'";s:3:"len";i:42;s:4:"last";i:42;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:10:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"DEFAULT";s:5:"value";s:7:"DEFAULT";s:7:"keyword";s:7:"DEFAULT";s:4:"type";i:1;s:5:"flags";i:35;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:24;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"'utf8_general_ci'";s:5:"value";s:15:"utf8_general_ci";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:25;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:10;s:3:"idx";i:10;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:7:"DEFAULT";}}s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:8;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:65;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET NAMES 'utf8' DEFAULT 'utf8_general_ci'", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES 'utf8' DEFAULT 'utf8_general_ci'", + "len": 42, + "last": 42, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "DEFAULT", + "value": "DEFAULT", + "keyword": "DEFAULT", + "type": 1, + "flags": 35, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 24 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8_general_ci'", + "value": "utf8_general_ci", + "keyword": null, + "type": 7, + "flags": 1, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 10, + "idx": 10 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "DEFAULT" + } + }, + "set": [], + "first": 0, + "last": 8 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@10" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseSetNamesError3.out b/tests/data/parser/parseSetNamesError3.out index a33d19827..ed9a09d9f 100644 --- a/tests/data/parser/parseSetNamesError3.out +++ b/tests/data/parser/parseSetNamesError3.out @@ -1 +1,496 @@ -a:4:{s:5:"query";s:24:"SET NAMES 'utf8' COLLATE";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:24:"SET NAMES 'utf8' COLLATE";s:3:"len";i:24;s:4:"last";i:24;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:8:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:3;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"NAMES";s:5:"value";s:5:"NAMES";s:7:"keyword";s:5:"NAMES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:4;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:9;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"'utf8'";s:5:"value";s:4:"utf8";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:1;s:8:"position";i:10;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"COLLATE";s:5:"value";s:7:"COLLATE";s:7:"keyword";s:7:"COLLATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:17;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:8;s:3:"idx";i:8;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Statements\SetStatement":5:{s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:3;a:4:{s:4:"name";s:5:"NAMES";s:6:"equals";b:0;s:4:"expr";s:6:"'utf8'";s:5:"value";s:4:"utf8";}}}s:11:"end_options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;a:4:{s:4:"name";s:7:"COLLATE";s:6:"equals";b:0;s:4:"expr";s:0:"";s:5:"value";s:0:"";}}}s:3:"set";a:0:{}s:5:"first";i:0;s:4:"last";i:6;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:53:"Value/Expression for the option COLLATE was expected.";i:1;r:51;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "SET NAMES 'utf8' COLLATE", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "SET NAMES 'utf8' COLLATE", + "len": 24, + "last": 24, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 3 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "NAMES", + "value": "NAMES", + "keyword": "NAMES", + "type": 1, + "flags": 1, + "position": 4 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 9 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "'utf8'", + "value": "utf8", + "keyword": null, + "type": 7, + "flags": 1, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COLLATE", + "value": "COLLATE", + "keyword": "COLLATE", + "type": 1, + "flags": 3, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 8, + "idx": 8 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "CLAUSES": { + "SET": [ + "SET", + 3 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "OPTIONS": { + "CHARSET": [ + 3, + "var" + ], + "CHARACTER SET": [ + 3, + "var" + ], + "NAMES": [ + 3, + "var" + ], + "PASSWORD": [ + 3, + "expr" + ], + "SESSION": 3, + "GLOBAL": 3, + "PERSIST": 3, + "PERSIST_ONLY": 3, + "@@SESSION": 3, + "@@GLOBAL": 3, + "@@PERSIST": 3, + "@@PERSIST_ONLY": 3 + }, + "END_OPTIONS": { + "COLLATE": [ + 1, + "var" + ], + "DEFAULT": 1 + }, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "3": { + "name": "NAMES", + "equals": false, + "expr": "'utf8'", + "value": "utf8" + } + } + }, + "end_options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": { + "name": "COLLATE", + "equals": false, + "expr": "", + "value": "" + } + } + }, + "set": [], + "first": 0, + "last": 6 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Value\/Expression for the option COLLATE was expected.", + { + "@type": "@8" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseTransaction.out b/tests/data/parser/parseTransaction.out index 7d54a4dda..75bbeef78 100644 --- a/tests/data/parser/parseTransaction.out +++ b/tests/data/parser/parseTransaction.out @@ -1,10 +1,1157 @@ -a:4:{s:5:"query";s:118:"START TRANSACTION; -SELECT @A:=SUM(salary) FROM table1 WHERE type=1; -UPDATE table2 SET summary=@A WHERE type=1; -COMMIT;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:118:"START TRANSACTION; -SELECT @A:=SUM(salary) FROM table1 WHERE type=1; -UPDATE table2 SET summary=@A WHERE type=1; -COMMIT;";s:3:"len";i:118;s:4:"last";i:118;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:43:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"START TRANSACTION";s:5:"value";s:17:"START TRANSACTION";s:7:"keyword";s:17:"START TRANSACTION";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:17;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@A";s:5:"value";s:1:"A";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:":=";s:5:"value";s:2:":=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:8;s:8:"position";i:28;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SUM";s:5:"value";s:3:"SUM";s:7:"keyword";s:3:"SUM";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"salary";s:5:"value";s:6:"salary";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"type";s:5:"value";s:4:"type";s:7:"keyword";s:4:"TYPE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:60;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:65;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:66;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:68;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"summary";s:5:"value";s:7:"summary";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:93;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@A";s:5:"value";s:1:"A";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:94;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:97;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"type";s:5:"value";s:4:"type";s:7:"keyword";s:4:"TYPE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:103;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:107;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:108;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:109;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"COMMIT";s:5:"value";s:6:"COMMIT";s:7:"keyword";s:6:"COMMIT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:111;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:117;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:43;s:3:"idx";i:43;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:1;s:10:"statements";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"@A:=SUM(salary)";s:5:"alias";N;s:8:"function";s:3:"SUM";s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:4:"type";}s:10:"isOperator";b:0;s:4:"expr";s:6:"type=1";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:1;s:4:"last";i:20;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:7:"summary";s:5:"value";s:2:"@A";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:4:"type";}s:10:"isOperator";b:0;s:4:"expr";s:6:"type=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:21;s:4:"last";i:37;}}s:3:"end";O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:2;s:10:"statements";N;s:3:"end";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"COMMIT";}}s:5:"first";i:38;s:4:"last";i:40;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:17:"START TRANSACTION";}}s:5:"first";i:0;s:4:"last";i:0;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "START TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "START TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;", + "len": 118, + "last": 118, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "START TRANSACTION", + "value": "START TRANSACTION", + "keyword": "START TRANSACTION", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@A", + "value": "A", + "keyword": null, + "type": 8, + "flags": 1, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":=", + "value": ":=", + "keyword": null, + "type": 2, + "flags": 8, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUM", + "value": "SUM", + "keyword": "SUM", + "type": 1, + "flags": 33, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "salary", + "value": "salary", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "type", + "value": "type", + "keyword": "TYPE", + "type": 1, + "flags": 1, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "summary", + "value": "summary", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@A", + "value": "A", + "keyword": null, + "type": 8, + "flags": 1, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "type", + "value": "type", + "keyword": "TYPE", + "type": 1, + "flags": 1, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COMMIT", + "value": "COMMIT", + "keyword": "COMMIT", + "type": 1, + "flags": 1, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 117 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 43, + "idx": 43 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 1, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "@A:=SUM(salary)", + "alias": null, + "function": "SUM", + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "type" + ], + "isOperator": false, + "expr": "type=1" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 1, + "last": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "summary", + "value": "@A" + } + ], + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "type" + ], + "isOperator": false, + "expr": "type=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 21, + "last": 37 + } + ], + "end": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 2, + "statements": null, + "end": null, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "COMMIT" + } + }, + "first": 38, + "last": 40 + }, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "START TRANSACTION" + } + }, + "first": 0, + "last": 0 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseTransaction2.out b/tests/data/parser/parseTransaction2.out index 5662ac9c2..2a034238c 100644 --- a/tests/data/parser/parseTransaction2.out +++ b/tests/data/parser/parseTransaction2.out @@ -1,10 +1,1157 @@ -a:4:{s:5:"query";s:120:"START TRANSACTION; -SELECT @A:=SUM(salary) FROM table1 WHERE type=1; -UPDATE table2 SET summary=@A WHERE type=1; -ROLLBACK;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:120:"START TRANSACTION; -SELECT @A:=SUM(salary) FROM table1 WHERE type=1; -UPDATE table2 SET summary=@A WHERE type=1; -ROLLBACK;";s:3:"len";i:120;s:4:"last";i:120;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:43:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:17:"START TRANSACTION";s:5:"value";s:17:"START TRANSACTION";s:7:"keyword";s:17:"START TRANSACTION";s:4:"type";i:1;s:5:"flags";i:7;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:17;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:19;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:25;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@A";s:5:"value";s:1:"A";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:26;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:":=";s:5:"value";s:2:":=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:8;s:8:"position";i:28;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SUM";s:5:"value";s:3:"SUM";s:7:"keyword";s:3:"SUM";s:4:"type";i:1;s:5:"flags";i:33;s:8:"position";i:30;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"(";s:5:"value";s:1:"(";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:33;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"salary";s:5:"value";s:6:"salary";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:34;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:")";s:5:"value";s:1:")";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:40;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:46;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table1";s:5:"value";s:6:"table1";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"type";s:5:"value";s:4:"type";s:7:"keyword";s:4:"TYPE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:60;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:65;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:66;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:67;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:68;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"table2";s:5:"value";s:6:"table2";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:75;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:82;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:85;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:7:"summary";s:5:"value";s:7:"summary";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:86;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:93;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"@A";s:5:"value";s:1:"A";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:1;s:8:"position";i:94;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:97;}i:34;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:102;}i:35;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"type";s:5:"value";s:4:"type";s:7:"keyword";s:4:"TYPE";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:103;}i:36;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:107;}i:37;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:108;}i:38;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:109;}i:39;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:110;}i:40;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"ROLLBACK";s:5:"value";s:8:"ROLLBACK";s:7:"keyword";s:8:"ROLLBACK";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:111;}i:41;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:119;}i:42;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:43;s:3:"idx";i:43;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:1;s:10:"statements";a:2:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:15:"@A:=SUM(salary)";s:5:"alias";N;s:8:"function";s:3:"SUM";s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table1";s:6:"column";N;s:4:"expr";s:6:"table1";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:4:"type";}s:10:"isOperator";b:0;s:4:"expr";s:6:"type=1";}}s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:1;s:4:"last";i:20;}i:1;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:6:"table2";s:6:"column";N;s:4:"expr";s:6:"table2";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:1:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:7:"summary";s:5:"value";s:2:"@A";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:4:"type";}s:10:"isOperator";b:0;s:4:"expr";s:6:"type=1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:21;s:4:"last";i:37;}}s:3:"end";O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:2;s:10:"statements";N;s:3:"end";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:8:"ROLLBACK";}}s:5:"first";i:38;s:4:"last";i:40;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:17:"START TRANSACTION";}}s:5:"first";i:0;s:4:"last";i:0;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "START TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nROLLBACK;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "START TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nROLLBACK;", + "len": 120, + "last": 120, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "START TRANSACTION", + "value": "START TRANSACTION", + "keyword": "START TRANSACTION", + "type": 1, + "flags": 7, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@A", + "value": "A", + "keyword": null, + "type": 8, + "flags": 1, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ":=", + "value": ":=", + "keyword": null, + "type": 2, + "flags": 8, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SUM", + "value": "SUM", + "keyword": "SUM", + "type": 1, + "flags": 33, + "position": 30 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "(", + "value": "(", + "keyword": null, + "type": 2, + "flags": 16, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "salary", + "value": "salary", + "keyword": null, + "type": 0, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ")", + "value": ")", + "keyword": null, + "type": 2, + "flags": 16, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 46 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table1", + "value": "table1", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "type", + "value": "type", + "keyword": "TYPE", + "type": 1, + "flags": 1, + "position": 60 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 65 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 66 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 68 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "table2", + "value": "table2", + "keyword": null, + "type": 0, + "flags": 0, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "summary", + "value": "summary", + "keyword": null, + "type": 0, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 93 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "@A", + "value": "A", + "keyword": null, + "type": 8, + "flags": 1, + "position": 94 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 102 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "type", + "value": "type", + "keyword": "TYPE", + "type": 1, + "flags": 1, + "position": 103 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 107 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 108 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 109 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 110 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "ROLLBACK", + "value": "ROLLBACK", + "keyword": "ROLLBACK", + "type": 1, + "flags": 1, + "position": 111 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 119 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 43, + "idx": 43 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 1, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "@A:=SUM(salary)", + "alias": null, + "function": "SUM", + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table1", + "column": null, + "expr": "table1", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "type" + ], + "isOperator": false, + "expr": "type=1" + } + ], + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 1, + "last": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "table2", + "column": null, + "expr": "table2", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "summary", + "value": "@A" + } + ], + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "type" + ], + "isOperator": false, + "expr": "type=1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 21, + "last": 37 + } + ], + "end": { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 2, + "statements": null, + "end": null, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "ROLLBACK" + } + }, + "first": 38, + "last": 40 + }, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "START TRANSACTION" + } + }, + "first": 0, + "last": 0 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseTransaction3.out b/tests/data/parser/parseTransaction3.out index 2d7416c65..1e17dbe49 100644 --- a/tests/data/parser/parseTransaction3.out +++ b/tests/data/parser/parseTransaction3.out @@ -1,10 +1,706 @@ -a:4:{s:5:"query";s:41:"begin; -SELECT * FROM `tablename` -commit; -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:41:"begin; -SELECT * FROM `tablename` -commit; -";s:3:"len";i:41;s:4:"last";i:41;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:15:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"begin";s:5:"value";s:5:"begin";s:7:"keyword";s:5:"BEGIN";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:5;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"SELECT";s:5:"value";s:6:"SELECT";s:7:"keyword";s:6:"SELECT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:7;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"*";s:5:"value";s:1:"*";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:4:"FROM";s:5:"value";s:4:"FROM";s:7:"keyword";s:4:"FROM";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:16;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:11:"`tablename`";s:5:"value";s:9:"tablename";s:7:"keyword";N;s:4:"type";i:8;s:5:"flags";i:2;s:8:"position";i:21;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:32;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"commit";s:5:"value";s:6:"commit";s:7:"keyword";s:6:"COMMIT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:33;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:39;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:15;s:3:"idx";i:15;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\SelectStatement":17:{s:4:"expr";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";N;s:6:"column";N;s:4:"expr";s:1:"*";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:4:"from";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:9:"tablename";s:6:"column";N;s:4:"expr";s:11:"`tablename`";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:11:"index_hints";N;s:9:"partition";N;s:5:"where";N;s:5:"group";N;s:6:"having";N;s:5:"order";N;s:5:"limit";N;s:9:"procedure";N;s:4:"into";N;s:4:"join";N;s:5:"union";a:0:{}s:11:"end_options";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:1;s:4:"last";i:10;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:76:"A new statement was found, but no delimiter between it and the previous one.";i:1;r:86;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "begin;\nSELECT * FROM `tablename`\ncommit;\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "begin;\nSELECT * FROM `tablename`\ncommit;\n", + "len": 41, + "last": 41, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "begin", + "value": "begin", + "keyword": "BEGIN", + "type": 1, + "flags": 1, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 5 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SELECT", + "value": "SELECT", + "keyword": "SELECT", + "type": 1, + "flags": 3, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "*", + "value": "*", + "keyword": null, + "type": 2, + "flags": 16, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "FROM", + "value": "FROM", + "keyword": "FROM", + "type": 1, + "flags": 3, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "`tablename`", + "value": "tablename", + "keyword": null, + "type": 8, + "flags": 2, + "position": 21 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "commit", + "value": "commit", + "keyword": "COMMIT", + "type": 1, + "flags": 1, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 39 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 15, + "idx": 15 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "OPTIONS": { + "ALL": 1, + "DISTINCT": 1, + "DISTINCTROW": 1, + "HIGH_PRIORITY": 2, + "MAX_STATEMENT_TIME": [ + 3, + "var=" + ], + "STRAIGHT_JOIN": 4, + "SQL_SMALL_RESULT": 5, + "SQL_BIG_RESULT": 6, + "SQL_BUFFER_RESULT": 7, + "SQL_CACHE": 8, + "SQL_NO_CACHE": 8, + "SQL_CALC_FOUND_ROWS": 9 + }, + "END_OPTIONS": { + "FOR UPDATE": 1, + "LOCK IN SHARE MODE": 1 + }, + "CLAUSES": { + "SELECT": [ + "SELECT", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_SELECT": [ + "SELECT", + 1 + ], + "INTO": [ + "INTO", + 3 + ], + "FROM": [ + "FROM", + 3 + ], + "FORCE": [ + "FORCE", + 1 + ], + "USE": [ + "USE", + 1 + ], + "IGNORE": [ + "IGNORE", + 3 + ], + "PARTITION": [ + "PARTITION", + 3 + ], + "JOIN": [ + "JOIN", + 1 + ], + "FULL JOIN": [ + "FULL JOIN", + 1 + ], + "INNER JOIN": [ + "INNER JOIN", + 1 + ], + "LEFT JOIN": [ + "LEFT JOIN", + 1 + ], + "LEFT OUTER JOIN": [ + "LEFT OUTER JOIN", + 1 + ], + "RIGHT JOIN": [ + "RIGHT JOIN", + 1 + ], + "RIGHT OUTER JOIN": [ + "RIGHT OUTER JOIN", + 1 + ], + "NATURAL JOIN": [ + "NATURAL JOIN", + 1 + ], + "NATURAL LEFT JOIN": [ + "NATURAL LEFT JOIN", + 1 + ], + "NATURAL RIGHT JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "NATURAL LEFT OUTER JOIN": [ + "NATURAL LEFT OUTER JOIN", + 1 + ], + "NATURAL RIGHT OUTER JOIN": [ + "NATURAL RIGHT JOIN", + 1 + ], + "WHERE": [ + "WHERE", + 3 + ], + "GROUP BY": [ + "GROUP BY", + 3 + ], + "HAVING": [ + "HAVING", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ], + "PROCEDURE": [ + "PROCEDURE", + 3 + ], + "UNION": [ + "UNION", + 1 + ], + "EXCEPT": [ + "EXCEPT", + 1 + ], + "INTERSECT": [ + "INTERSECT", + 1 + ], + "_END_OPTIONS": [ + "_END_OPTIONS", + 1 + ] + }, + "expr": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": null, + "column": null, + "expr": "*", + "alias": null, + "function": null, + "subquery": null + } + ], + "from": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "tablename", + "column": null, + "expr": "`tablename`", + "alias": null, + "function": null, + "subquery": null + } + ], + "index_hints": null, + "partition": null, + "where": null, + "group": null, + "having": null, + "order": null, + "limit": null, + "procedure": null, + "into": null, + "join": null, + "union": [], + "end_options": null, + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 1, + "last": 10 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "A new statement was found, but no delimiter between it and the previous one.", + { + "@type": "@13" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseTransactionErr1.out b/tests/data/parser/parseTransactionErr1.out index da3624c7e..1cb8affba 100644 --- a/tests/data/parser/parseTransactionErr1.out +++ b/tests/data/parser/parseTransactionErr1.out @@ -1 +1,408 @@ -a:4:{s:5:"query";s:7:"COMMIT;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:7:"COMMIT;";s:3:"len";i:7;s:4:"last";i:7;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:3:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"COMMIT";s:5:"value";s:6:"COMMIT";s:7:"keyword";s:6:"COMMIT";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:3;s:3:"idx";i:3;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:52:"PhpMyAdmin\SqlParser\Statements\TransactionStatement":6:{s:4:"type";i:2;s:10:"statements";N;s:3:"end";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:1:{i:1;s:6:"COMMIT";}}s:5:"first";i:0;s:4:"last";i:0;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:38:"No transaction was previously started.";i:1;r:9;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "COMMIT;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "COMMIT;", + "len": 7, + "last": 7, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "COMMIT", + "value": "COMMIT", + "keyword": "COMMIT", + "type": 1, + "flags": 1, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 3, + "idx": 3 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "type": 2, + "statements": null, + "end": null, + "OPTIONS": { + "START TRANSACTION": 1, + "BEGIN": 1, + "COMMIT": 1, + "ROLLBACK": 1, + "WITH CONSISTENT SNAPSHOT": 2, + "WORK": 2, + "AND NO CHAIN": 3, + "AND CHAIN": 3, + "RELEASE": 4, + "NO RELEASE": 4 + }, + "CLAUSES": [], + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": { + "1": "COMMIT" + } + }, + "first": 0, + "last": 0 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "No transaction was previously started.", + { + "@type": "@2" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUnlock1.out b/tests/data/parser/parseUnlock1.out index 044bfab7f..4d3a4a348 100644 --- a/tests/data/parser/parseUnlock1.out +++ b/tests/data/parser/parseUnlock1.out @@ -1 +1,401 @@ -a:4:{s:5:"query";s:14:"UNLOCK TABLES;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:14:"UNLOCK TABLES;";s:3:"len";i:14;s:4:"last";i:14;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:5:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UNLOCK";s:5:"value";s:6:"UNLOCK";s:7:"keyword";s:6:"UNLOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:5;s:3:"idx";i:5;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:0:{}s:6:"isLock";b:0;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:3;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "UNLOCK TABLES;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "UNLOCK TABLES;", + "len": 14, + "last": 14, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNLOCK", + "value": "UNLOCK", + "keyword": "UNLOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 5, + "idx": 5 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [], + "isLock": false, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 3 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUnlockErr1.out b/tests/data/parser/parseUnlockErr1.out index 6e3757278..07ffc3cc5 100644 --- a/tests/data/parser/parseUnlockErr1.out +++ b/tests/data/parser/parseUnlockErr1.out @@ -1 +1,427 @@ -a:4:{s:5:"query";s:18:"UNLOCK TABLES abc;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:18:"UNLOCK TABLES abc;";s:3:"len";i:18;s:4:"last";i:18;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:7:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UNLOCK";s:5:"value";s:6:"UNLOCK";s:7:"keyword";s:6:"UNLOCK";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"TABLES";s:5:"value";s:6:"TABLES";s:7:"keyword";s:6:"TABLES";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:13;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"abc";s:5:"value";s:3:"abc";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:14;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:17;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:7;s:3:"idx";i:7;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:45:"PhpMyAdmin\SqlParser\Statements\LockStatement":5:{s:6:"locked";a:0:{}s:6:"isLock";b:0;s:7:"options";N;s:5:"first";i:0;s:4:"last";i:4;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:37;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "UNLOCK TABLES abc;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "UNLOCK TABLES abc;", + "len": 18, + "last": 18, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UNLOCK", + "value": "UNLOCK", + "keyword": "UNLOCK", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "TABLES", + "value": "TABLES", + "keyword": "TABLES", + "type": 1, + "flags": 1, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 13 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "abc", + "value": "abc", + "keyword": null, + "type": 0, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 7, + "idx": 7 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "locked": [], + "isLock": false, + "OPTIONS": [], + "CLAUSES": [], + "END_OPTIONS": [], + "options": null, + "first": 0, + "last": 4 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@6" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUpdate.out b/tests/data/parser/parseUpdate.out index 6a26d3cca..33e909246 100644 --- a/tests/data/parser/parseUpdate.out +++ b/tests/data/parser/parseUpdate.out @@ -1,13 +1,591 @@ -a:4:{s:5:"query";s:54:"UPDATE - users -SET - username = "Dan", - id=155;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:54:"UPDATE - users -SET - username = "Dan", - id=155;";s:3:"len";i:54;s:4:"last";i:54;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:18:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""Dan"";s:5:"value";s:3:"Dan";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:36;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"155";s:5:"value";i:155;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:53;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:18;s:3:"idx";i:18;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:8:"username";s:5:"value";s:5:""Dan"";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"id";s:5:"value";s:3:"155";}}s:5:"where";N;s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:15;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "UPDATE\n users\nSET\n username = \"Dan\",\n id=155;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "UPDATE\n users\nSET\n username = \"Dan\",\n id=155;", + "len": 54, + "last": 54, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Dan\"", + "value": "Dan", + "keyword": null, + "type": 7, + "flags": 2, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "155", + "value": 155, + "keyword": null, + "type": 6, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 18, + "idx": 18 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "username", + "value": "\"Dan\"" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "id", + "value": "155" + } + ], + "where": null, + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 15 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUpdate2.out b/tests/data/parser/parseUpdate2.out index 1e154fb4b..b35088140 100644 --- a/tests/data/parser/parseUpdate2.out +++ b/tests/data/parser/parseUpdate2.out @@ -1,22 +1,776 @@ -a:4:{s:5:"query";s:99:"UPDATE - users -SET - username = "Dan", - id=155 -WHERE - username = "Paul" -LIMIT 1 OFFSET 2;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:99:"UPDATE - users -SET - username = "Dan", - id=155 -WHERE - username = "Paul" -LIMIT 1 OFFSET 2;";s:3:"len";i:99;s:4:"last";i:99;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:34:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:11;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:16;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:17;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:25;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:34;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""Dan"";s:5:"value";s:3:"Dan";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:36;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:41;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:42;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:47;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:49;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"155";s:5:"value";i:155;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:50;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:54;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:59;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:64;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:72;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:73;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:""Paul"";s:5:"value";s:4:"Paul";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:75;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:81;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"LIMIT";s:5:"value";s:5:"LIMIT";s:7:"keyword";s:5:"LIMIT";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:82;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:87;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:88;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:89;}i:29;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"OFFSET";s:5:"value";s:6:"OFFSET";s:7:"keyword";s:6:"OFFSET";s:4:"type";i:1;s:5:"flags";i:1;s:8:"position";i:90;}i:30;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:96;}i:31;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"2";s:5:"value";i:2;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:97;}i:32;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:98;}i:33;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:34;s:3:"idx";i:34;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:8:"username";s:5:"value";s:5:""Dan"";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"id";s:5:"value";s:3:"155";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:2:{i:0;s:8:"username";i:1;s:4:"Paul";}s:10:"isOperator";b:0;s:4:"expr";s:17:"username = "Paul"";}}s:5:"order";N;s:5:"limit";O:37:"PhpMyAdmin\SqlParser\Components\Limit":2:{s:6:"offset";i:2;s:8:"rowCount";i:1;}s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:31;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:0:{}}} \ No newline at end of file +{ + "query": "UPDATE\n users\nSET\n username = \"Dan\",\n id=155\nWHERE\n username = \"Paul\"\nLIMIT 1 OFFSET 2;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "UPDATE\n users\nSET\n username = \"Dan\",\n id=155\nWHERE\n username = \"Paul\"\nLIMIT 1 OFFSET 2;", + "len": 99, + "last": 99, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 16 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 17 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 25 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Dan\"", + "value": "Dan", + "keyword": null, + "type": 7, + "flags": 2, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 41 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 42 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 47 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 49 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "155", + "value": 155, + "keyword": null, + "type": 6, + "flags": 0, + "position": 50 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 59 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 64 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 72 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Paul\"", + "value": "Paul", + "keyword": null, + "type": 7, + "flags": 2, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "LIMIT", + "value": "LIMIT", + "keyword": "LIMIT", + "type": 1, + "flags": 3, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 87 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 88 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 89 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "OFFSET", + "value": "OFFSET", + "keyword": "OFFSET", + "type": 1, + "flags": 1, + "position": 90 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 96 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "2", + "value": 2, + "keyword": null, + "type": 6, + "flags": 0, + "position": 97 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 98 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 34, + "idx": 34 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "username", + "value": "\"Dan\"" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "id", + "value": "155" + } + ], + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "username", + "Paul" + ], + "isOperator": false, + "expr": "username = \"Paul\"" + } + ], + "order": null, + "limit": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "offset": 2, + "rowCount": 1 + }, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 31 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUpdate3.out b/tests/data/parser/parseUpdate3.out index 86b345cef..f5df16294 100644 --- a/tests/data/parser/parseUpdate3.out +++ b/tests/data/parser/parseUpdate3.out @@ -1,4 +1,633 @@ -a:4:{s:5:"query";s:36:"UPDATE foo SET bar = WHERE baz = 0 -";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:36:"UPDATE foo SET bar = WHERE baz = 0 -";s:3:"len";i:36;s:4:"last";i:36;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:19:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:6;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"foo";s:5:"value";s:3:"foo";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:7;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:10;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:11;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:14;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"bar";s:5:"value";s:3:"bar";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:15;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:18;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:19;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:20;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:22;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:27;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"baz";s:5:"value";s:3:"baz";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:28;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:31;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:32;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:33;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"0";s:5:"value";i:0;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:34;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:35;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:19;s:3:"idx";i:19;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:3:"foo";s:6:"column";N;s:4:"expr";s:3:"foo";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:0:{}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:1:{i:0;s:3:"baz";}s:10:"isOperator";b:0;s:4:"expr";s:7:"baz = 0";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:17;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:19:"Missing expression.";i:1;r:79;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "UPDATE foo SET bar = WHERE baz = 0\n", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "UPDATE foo SET bar = WHERE baz = 0\n", + "len": 36, + "last": 36, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 6 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "foo", + "value": "foo", + "keyword": null, + "type": 0, + "flags": 0, + "position": 7 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 10 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 11 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 14 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "bar", + "value": "bar", + "keyword": null, + "type": 0, + "flags": 0, + "position": 15 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 18 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 22 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 27 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "baz", + "value": "baz", + "keyword": null, + "type": 0, + "flags": 0, + "position": 28 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 32 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 33 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "0", + "value": 0, + "keyword": null, + "type": 6, + "flags": 0, + "position": 34 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 35 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 19, + "idx": 19 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "foo", + "column": null, + "expr": "foo", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [], + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [ + "baz" + ], + "isOperator": false, + "expr": "baz = 0" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 17 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Missing expression.", + { + "@type": "@12" + }, + 0 + ] + ] + } +} \ No newline at end of file diff --git a/tests/data/parser/parseUpdateErr.out b/tests/data/parser/parseUpdateErr.out index af8b028bc..56b0ce9e9 100644 --- a/tests/data/parser/parseUpdateErr.out +++ b/tests/data/parser/parseUpdateErr.out @@ -1,19 +1,732 @@ -a:4:{s:5:"query";s:87:"-- extraneous comma -UPDATE - users -SET - username = "Dan", - id=155, -WHERE 1 = 1;";s:5:"lexer";O:26:"PhpMyAdmin\SqlParser\Lexer":8:{s:3:"str";s:87:"-- extraneous comma -UPDATE - users -SET - username = "Dan", - id=155, -WHERE 1 = 1;";s:3:"len";i:87;s:4:"last";i:87;s:4:"list";O:31:"PhpMyAdmin\SqlParser\TokensList":3:{s:6:"tokens";a:29:{i:0;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:19:"-- extraneous comma";s:5:"value";s:19:"-- extraneous comma";s:7:"keyword";N;s:4:"type";i:4;s:5:"flags";i:4;s:8:"position";i:0;}i:1;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:19;}i:2;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:6:"UPDATE";s:5:"value";s:6:"UPDATE";s:7:"keyword";s:6:"UPDATE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:20;}i:3;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:26;}i:4;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"users";s:5:"value";s:5:"users";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:31;}i:5;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:36;}i:6;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"SET";s:5:"value";s:3:"SET";s:7:"keyword";s:3:"SET";s:4:"type";i:1;s:5:"flags";i:11;s:8:"position";i:37;}i:7;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:40;}i:8;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:8:"username";s:5:"value";s:8:"username";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:45;}i:9;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:53;}i:10;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:54;}i:11;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:55;}i:12;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:""Dan"";s:5:"value";s:3:"Dan";s:7:"keyword";N;s:4:"type";i:7;s:5:"flags";i:2;s:8:"position";i:56;}i:13;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:61;}i:14;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:" - ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:62;}i:15;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:2:"id";s:5:"value";s:2:"id";s:7:"keyword";N;s:4:"type";i:0;s:5:"flags";i:0;s:8:"position";i:67;}i:16;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:69;}i:17;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:3:"155";s:5:"value";i:155;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:70;}i:18;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:",";s:5:"value";s:1:",";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:16;s:8:"position";i:73;}i:19;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" -";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:74;}i:20;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:5:"WHERE";s:5:"value";s:5:"WHERE";s:7:"keyword";s:5:"WHERE";s:4:"type";i:1;s:5:"flags";i:3;s:8:"position";i:75;}i:21;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:80;}i:22;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:81;}i:23;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:82;}i:24;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"=";s:5:"value";s:1:"=";s:7:"keyword";N;s:4:"type";i:2;s:5:"flags";i:2;s:8:"position";i:83;}i:25;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:" ";s:5:"value";s:1:" ";s:7:"keyword";N;s:4:"type";i:3;s:5:"flags";i:0;s:8:"position";i:84;}i:26;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:"1";s:5:"value";i:1;s:7:"keyword";N;s:4:"type";i:6;s:5:"flags";i:0;s:8:"position";i:85;}i:27;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";s:1:";";s:5:"value";s:1:";";s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";i:86;}i:28;O:26:"PhpMyAdmin\SqlParser\Token":6:{s:5:"token";N;s:5:"value";N;s:7:"keyword";N;s:4:"type";i:9;s:5:"flags";i:0;s:8:"position";N;}}s:5:"count";i:29;s:3:"idx";i:29;}s:9:"delimiter";s:1:";";s:12:"delimiterLen";i:1;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"parser";O:27:"PhpMyAdmin\SqlParser\Parser":5:{s:4:"list";r:7;s:10:"statements";a:1:{i:0;O:47:"PhpMyAdmin\SqlParser\Statements\UpdateStatement":8:{s:6:"tables";a:1:{i:0;O:42:"PhpMyAdmin\SqlParser\Components\Expression":7:{s:8:"database";N;s:5:"table";s:5:"users";s:6:"column";N;s:4:"expr";s:5:"users";s:5:"alias";N;s:8:"function";N;s:8:"subquery";N;}}s:3:"set";a:2:{i:0;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:8:"username";s:5:"value";s:5:""Dan"";}i:1;O:44:"PhpMyAdmin\SqlParser\Components\SetOperation":2:{s:6:"column";s:2:"id";s:5:"value";s:3:"155";}}s:5:"where";a:1:{i:0;O:41:"PhpMyAdmin\SqlParser\Components\Condition":3:{s:11:"identifiers";a:0:{}s:10:"isOperator";b:0;s:4:"expr";s:5:"1 = 1";}}s:5:"order";N;s:5:"limit";N;s:7:"options";O:44:"PhpMyAdmin\SqlParser\Components\OptionsArray":1:{s:7:"options";a:0:{}}s:5:"first";i:0;s:4:"last";i:26;}}s:8:"brackets";i:0;s:6:"strict";b:0;s:6:"errors";a:0:{}}s:6:"errors";a:2:{s:5:"lexer";a:0:{}s:6:"parser";a:1:{i:0;a:3:{i:0;s:17:"Unexpected token.";i:1;r:135;i:2;i:0;}}}} \ No newline at end of file +{ + "query": "-- extraneous comma\nUPDATE\n users\nSET\n username = \"Dan\",\n id=155,\nWHERE 1 = 1;", + "lexer": { + "@type": "PhpMyAdmin\\SqlParser\\Lexer", + "PARSER_METHODS": [ + "parseDelimiter", + "parseWhitespace", + "parseNumber", + "parseComment", + "parseOperator", + "parseBool", + "parseString", + "parseSymbol", + "parseKeyword", + "parseLabel", + "parseUnknown" + ], + "str": "-- extraneous comma\nUPDATE\n users\nSET\n username = \"Dan\",\n id=155,\nWHERE 1 = 1;", + "len": 87, + "last": 87, + "list": { + "@type": "PhpMyAdmin\\SqlParser\\TokensList", + "tokens": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "-- extraneous comma", + "value": "-- extraneous comma", + "keyword": null, + "type": 4, + "flags": 4, + "position": 0 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 19 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "UPDATE", + "value": "UPDATE", + "keyword": "UPDATE", + "type": 1, + "flags": 3, + "position": 20 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 26 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "users", + "value": "users", + "keyword": null, + "type": 0, + "flags": 0, + "position": 31 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 36 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "SET", + "value": "SET", + "keyword": "SET", + "type": 1, + "flags": 11, + "position": 37 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 40 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "username", + "value": "username", + "keyword": null, + "type": 0, + "flags": 0, + "position": 45 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 53 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 54 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 55 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\"Dan\"", + "value": "Dan", + "keyword": null, + "type": 7, + "flags": 2, + "position": 56 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 61 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 62 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "id", + "value": "id", + "keyword": null, + "type": 0, + "flags": 0, + "position": 67 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 69 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "155", + "value": 155, + "keyword": null, + "type": 6, + "flags": 0, + "position": 70 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ",", + "value": ",", + "keyword": null, + "type": 2, + "flags": 16, + "position": 73 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "\n", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 74 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "WHERE", + "value": "WHERE", + "keyword": "WHERE", + "type": 1, + "flags": 3, + "position": 75 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 80 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 81 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 82 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "=", + "value": "=", + "keyword": null, + "type": 2, + "flags": 2, + "position": 83 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": " ", + "value": " ", + "keyword": null, + "type": 3, + "flags": 0, + "position": 84 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": "1", + "value": 1, + "keyword": null, + "type": 6, + "flags": 0, + "position": 85 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": ";", + "value": ";", + "keyword": null, + "type": 9, + "flags": 0, + "position": 86 + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Token", + "token": null, + "value": null, + "keyword": null, + "type": 9, + "flags": 0, + "position": null + } + ], + "count": 29, + "idx": 29 + }, + "DEFAULT_DELIMITER": ";", + "delimiter": ";", + "delimiterLen": 1, + "strict": false, + "errors": [] + }, + "parser": { + "@type": "PhpMyAdmin\\SqlParser\\Parser", + "STATEMENT_PARSERS": { + "DESCRIBE": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "DESC": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "EXPLAIN": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", + "FLUSH": "", + "GRANT": "", + "HELP": "", + "SET PASSWORD": "", + "STATUS": "", + "USE": "", + "ANALYZE": "PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement", + "BACKUP": "PhpMyAdmin\\SqlParser\\Statements\\BackupStatement", + "CHECK": "PhpMyAdmin\\SqlParser\\Statements\\CheckStatement", + "CHECKSUM": "PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement", + "OPTIMIZE": "PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement", + "REPAIR": "PhpMyAdmin\\SqlParser\\Statements\\RepairStatement", + "RESTORE": "PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement", + "SET": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement", + "SHOW": "PhpMyAdmin\\SqlParser\\Statements\\ShowStatement", + "ALTER": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", + "CREATE": "PhpMyAdmin\\SqlParser\\Statements\\CreateStatement", + "DROP": "PhpMyAdmin\\SqlParser\\Statements\\DropStatement", + "RENAME": "PhpMyAdmin\\SqlParser\\Statements\\RenameStatement", + "TRUNCATE": "PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement", + "CALL": "PhpMyAdmin\\SqlParser\\Statements\\CallStatement", + "DELETE": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement", + "DO": "", + "HANDLER": "", + "INSERT": "PhpMyAdmin\\SqlParser\\Statements\\InsertStatement", + "LOAD DATA": "PhpMyAdmin\\SqlParser\\Statements\\LoadStatement", + "REPLACE": "PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement", + "SELECT": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement", + "UPDATE": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "WITH": "PhpMyAdmin\\SqlParser\\Statements\\WithStatement", + "DEALLOCATE": "", + "EXECUTE": "", + "PREPARE": "", + "BEGIN": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "COMMIT": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "ROLLBACK": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "START TRANSACTION": "PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement", + "PURGE": "PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement", + "LOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement", + "UNLOCK": "PhpMyAdmin\\SqlParser\\Statements\\LockStatement" + }, + "KEYWORD_PARSERS": { + "PARTITION BY": [], + "SUBPARTITION BY": [], + "_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "options" + }, + "_END_OPTIONS": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "field": "end_options" + }, + "INTERSECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "EXCEPT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION ALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "UNION DISTINCT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\UnionKeyword", + "field": "union" + }, + "ALTER": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "ANALYZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "BACKUP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CALL": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "call" + }, + "CHECK": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CHECKSUM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "CROSS JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "DROP": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "fields", + "options": { + "parseField": "table" + } + }, + "FORCE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "FROM": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "from", + "options": { + "field": "table" + } + }, + "GROUP BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\GroupKeyword", + "field": "group" + }, + "HAVING": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "having" + }, + "IGNORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "INTO": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IntoKeyword", + "field": "into" + }, + "JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "ON": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "INNER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "FULL OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL LEFT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "NATURAL RIGHT OUTER JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "STRAIGHT_JOIN": { + "class": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword", + "field": "join" + }, + "LIMIT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Limit", + "field": "limit" + }, + "OPTIMIZE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "ORDER BY": { + "class": "PhpMyAdmin\\SqlParser\\Components\\OrderKeyword", + "field": "order" + }, + "PARTITION": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ArrayObj", + "field": "partition" + }, + "PROCEDURE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\FunctionCall", + "field": "procedure" + }, + "RENAME": { + "class": "PhpMyAdmin\\SqlParser\\Components\\RenameOperation", + "field": "renames" + }, + "REPAIR": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "RESTORE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "SET": { + "class": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "field": "set" + }, + "SELECT": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "expr" + }, + "TRUNCATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "field": "table", + "options": { + "parseField": "table" + } + }, + "UPDATE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\ExpressionArray", + "field": "tables", + "options": { + "parseField": "table" + } + }, + "USE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\IndexHint", + "field": "index_hints" + }, + "VALUE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "VALUES": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Array2d", + "field": "values" + }, + "WHERE": { + "class": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "field": "where" + } + }, + "list": { + "@type": "@1" + }, + "statements": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement", + "OPTIONS": { + "LOW_PRIORITY": 1, + "IGNORE": 2 + }, + "CLAUSES": { + "UPDATE": [ + "UPDATE", + 2 + ], + "_OPTIONS": [ + "_OPTIONS", + 1 + ], + "_UPDATE": [ + "UPDATE", + 1 + ], + "SET": [ + "SET", + 3 + ], + "WHERE": [ + "WHERE", + 3 + ], + "ORDER BY": [ + "ORDER BY", + 3 + ], + "LIMIT": [ + "LIMIT", + 3 + ] + }, + "tables": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", + "ALLOWED_KEYWORDS": { + "AS": 1, + "DUAL": 1, + "NULL": 1, + "REGEXP": 1, + "CASE": 1, + "DIV": 1, + "AND": 1, + "OR": 1, + "XOR": 1, + "NOT": 1, + "MOD": 1 + }, + "database": null, + "table": "users", + "column": null, + "expr": "users", + "alias": null, + "function": null, + "subquery": null + } + ], + "set": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "username", + "value": "\"Dan\"" + }, + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation", + "column": "id", + "value": "155" + } + ], + "where": [ + { + "@type": "PhpMyAdmin\\SqlParser\\Components\\Condition", + "DELIMITERS": [ + "&&", + "||", + "AND", + "OR", + "XOR" + ], + "ALLOWED_KEYWORDS": { + "ALL": 1, + "AND": 1, + "BETWEEN": 1, + "EXISTS": 1, + "IF": 1, + "IN": 1, + "INTERVAL": 1, + "IS": 1, + "LIKE": 1, + "MATCH": 1, + "NOT IN": 1, + "NOT NULL": 1, + "NOT": 1, + "NULL": 1, + "OR": 1, + "REGEXP": 1, + "RLIKE": 1, + "XOR": 1 + }, + "identifiers": [], + "isOperator": false, + "expr": "1 = 1" + } + ], + "order": null, + "limit": null, + "END_OPTIONS": [], + "options": { + "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", + "options": [] + }, + "first": 0, + "last": 26 + } + ], + "brackets": 0, + "strict": false, + "errors": [] + }, + "errors": { + "lexer": [], + "parser": [ + [ + "Unexpected token.", + { + "@type": "@20" + }, + 0 + ] + ] + } +} \ No newline at end of file