-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ref #447 - Add test cases for
TABLE
statements
Signed-off-by: William Desportes <[email protected]>
- Loading branch information
1 parent
876af83
commit cddd0f1
Showing
6 changed files
with
368 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DESC TABLE `fo` ORDER BY `fo`.`uuid` ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
{ | ||
"query": "DESC TABLE `fo` ORDER BY `fo`.`uuid` ASC;", | ||
"lexer": { | ||
"@type": "PhpMyAdmin\\SqlParser\\Lexer", | ||
"str": "DESC TABLE `fo` ORDER BY `fo`.`uuid` ASC;", | ||
"len": 41, | ||
"last": 41, | ||
"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": "TABLE", | ||
"value": "TABLE", | ||
"keyword": "TABLE", | ||
"type": 1, | ||
"flags": 3, | ||
"position": 5 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": " ", | ||
"value": " ", | ||
"keyword": null, | ||
"type": 3, | ||
"flags": 0, | ||
"position": 10 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "`fo`", | ||
"value": "fo", | ||
"keyword": null, | ||
"type": 8, | ||
"flags": 2, | ||
"position": 11 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": " ", | ||
"value": " ", | ||
"keyword": null, | ||
"type": 3, | ||
"flags": 0, | ||
"position": 15 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "ORDER BY", | ||
"value": "ORDER BY", | ||
"keyword": "ORDER BY", | ||
"type": 1, | ||
"flags": 7, | ||
"position": 16 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": " ", | ||
"value": " ", | ||
"keyword": null, | ||
"type": 3, | ||
"flags": 0, | ||
"position": 24 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "`fo`", | ||
"value": "fo", | ||
"keyword": null, | ||
"type": 8, | ||
"flags": 2, | ||
"position": 25 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": ".", | ||
"value": ".", | ||
"keyword": null, | ||
"type": 2, | ||
"flags": 16, | ||
"position": 29 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "`uuid`", | ||
"value": "uuid", | ||
"keyword": null, | ||
"type": 8, | ||
"flags": 2, | ||
"position": 30 | ||
}, | ||
{ | ||
"@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": ";", | ||
"value": ";", | ||
"keyword": null, | ||
"type": 9, | ||
"flags": 0, | ||
"position": 40 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": null, | ||
"value": null, | ||
"keyword": null, | ||
"type": 9, | ||
"flags": 0, | ||
"position": null | ||
} | ||
], | ||
"count": 15, | ||
"idx": 15 | ||
}, | ||
"delimiter": ";", | ||
"delimiterLen": 1, | ||
"strict": false, | ||
"errors": [] | ||
}, | ||
"parser": { | ||
"@type": "PhpMyAdmin\\SqlParser\\Parser", | ||
"list": { | ||
"@type": "@1" | ||
}, | ||
"statements": [ | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement", | ||
"bodyParser": null, | ||
"statementAlias": "DESC", | ||
"connectionId": null, | ||
"explainedTable": null, | ||
"options": { | ||
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", | ||
"options": [] | ||
}, | ||
"first": 0, | ||
"last": 2 | ||
} | ||
], | ||
"brackets": 0, | ||
"strict": false, | ||
"errors": [] | ||
}, | ||
"errors": { | ||
"lexer": [], | ||
"parser": [ | ||
[ | ||
"Unexpected token.", | ||
{ | ||
"@type": "@4" | ||
}, | ||
0 | ||
], | ||
[ | ||
"Unexpected beginning of statement.", | ||
{ | ||
"@type": "@6" | ||
}, | ||
0 | ||
], | ||
[ | ||
"Unrecognized statement type.", | ||
{ | ||
"@type": "@8" | ||
}, | ||
0 | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TABLE `fo` ORDER BY `fo`.`uuid` ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"query": "TABLE `fo` ORDER BY `fo`.`uuid` ASC;", | ||
"lexer": { | ||
"@type": "PhpMyAdmin\\SqlParser\\Lexer", | ||
"str": "TABLE `fo` ORDER BY `fo`.`uuid` ASC;", | ||
"len": 36, | ||
"last": 36, | ||
"list": { | ||
"@type": "PhpMyAdmin\\SqlParser\\TokensList", | ||
"tokens": [ | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "TABLE", | ||
"value": "TABLE", | ||
"keyword": "TABLE", | ||
"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": "`fo`", | ||
"value": "fo", | ||
"keyword": null, | ||
"type": 8, | ||
"flags": 2, | ||
"position": 6 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": " ", | ||
"value": " ", | ||
"keyword": null, | ||
"type": 3, | ||
"flags": 0, | ||
"position": 10 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "ORDER BY", | ||
"value": "ORDER BY", | ||
"keyword": "ORDER BY", | ||
"type": 1, | ||
"flags": 7, | ||
"position": 11 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": " ", | ||
"value": " ", | ||
"keyword": null, | ||
"type": 3, | ||
"flags": 0, | ||
"position": 19 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "`fo`", | ||
"value": "fo", | ||
"keyword": null, | ||
"type": 8, | ||
"flags": 2, | ||
"position": 20 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": ".", | ||
"value": ".", | ||
"keyword": null, | ||
"type": 2, | ||
"flags": 16, | ||
"position": 24 | ||
}, | ||
{ | ||
"@type": "PhpMyAdmin\\SqlParser\\Token", | ||
"token": "`uuid`", | ||
"value": "uuid", | ||
"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": "ASC", | ||
"value": "ASC", | ||
"keyword": "ASC", | ||
"type": 1, | ||
"flags": 3, | ||
"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": 13, | ||
"idx": 13 | ||
}, | ||
"delimiter": ";", | ||
"delimiterLen": 1, | ||
"strict": false, | ||
"errors": [] | ||
}, | ||
"parser": { | ||
"@type": "PhpMyAdmin\\SqlParser\\Parser", | ||
"list": { | ||
"@type": "@1" | ||
}, | ||
"statements": [], | ||
"brackets": 0, | ||
"strict": false, | ||
"errors": [] | ||
}, | ||
"errors": { | ||
"lexer": [], | ||
"parser": [ | ||
[ | ||
"Unrecognized statement type.", | ||
{ | ||
"@type": "@2" | ||
}, | ||
0 | ||
] | ||
] | ||
} | ||
} |