-
-
Notifications
You must be signed in to change notification settings - Fork 110
Fix #592 - desc index #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
predictor2718
wants to merge
4
commits into
phpmyadmin:6.0.x
Choose a base branch
from
predictor2718:fix-592-desc-index
base: 6.0.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,480
−1
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
54b5586
Fix ALTER index parsing: DESC should not begin a new statement (#592)
predictor2718 bc4e5e9
Add test for DESC index (#592)
predictor2718 5b35ae7
Fix too long line - phpcs linting hint (#592)
predictor2718 eac040f
Add tests for ASC and lowercase keyword (#592)
predictor2718 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| ALTER TABLE `bad_table_is_bad` ADD UNIQUE KEY `column1` (`column1`, `column2` ASC); |
This file contains hidden or 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,357 @@ | ||
| { | ||
| "query": "ALTER TABLE `bad_table_is_bad` ADD UNIQUE KEY `column1` (`column1`, `column2` ASC);", | ||
| "lexer": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Lexer", | ||
| "strict": false, | ||
| "errors": [], | ||
| "str": "ALTER TABLE `bad_table_is_bad` ADD UNIQUE KEY `column1` (`column1`, `column2` ASC);", | ||
| "len": 83, | ||
| "last": 83, | ||
| "list": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokensList", | ||
| "count": 22, | ||
| "idx": 22, | ||
| "tokens": [ | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "ALTER", | ||
| "value": "ALTER", | ||
| "keyword": "ALTER", | ||
| "type": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokenType", | ||
| "name": "Keyword", | ||
| "value": 1 | ||
| }, | ||
| "flags": 3, | ||
| "position": 0 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokenType", | ||
| "name": "Whitespace", | ||
| "value": 3 | ||
| }, | ||
| "flags": 0, | ||
| "position": 5 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "TABLE", | ||
| "value": "TABLE", | ||
| "keyword": "TABLE", | ||
| "type": { | ||
| "@type": "@3" | ||
| }, | ||
| "flags": 3, | ||
| "position": 6 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 11 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "`bad_table_is_bad`", | ||
| "value": "bad_table_is_bad", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokenType", | ||
| "name": "Symbol", | ||
| "value": 8 | ||
| }, | ||
| "flags": 2, | ||
| "position": 12 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 30 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "ADD", | ||
| "value": "ADD", | ||
| "keyword": "ADD", | ||
| "type": { | ||
| "@type": "@3" | ||
| }, | ||
| "flags": 3, | ||
| "position": 31 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 34 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "UNIQUE KEY", | ||
| "value": "UNIQUE KEY", | ||
| "keyword": "UNIQUE KEY", | ||
| "type": { | ||
| "@type": "@3" | ||
| }, | ||
| "flags": 23, | ||
| "position": 35 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 45 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "`column1`", | ||
| "value": "column1", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@9" | ||
| }, | ||
| "flags": 2, | ||
| "position": 46 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 55 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "(", | ||
| "value": "(", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokenType", | ||
| "name": "Operator", | ||
| "value": 2 | ||
| }, | ||
| "flags": 16, | ||
| "position": 56 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "`column1`", | ||
| "value": "column1", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@9" | ||
| }, | ||
| "flags": 2, | ||
| "position": 57 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": ",", | ||
| "value": ",", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@18" | ||
| }, | ||
| "flags": 16, | ||
| "position": 66 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 67 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "`column2`", | ||
| "value": "column2", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@9" | ||
| }, | ||
| "flags": 2, | ||
| "position": 68 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": " ", | ||
| "value": " ", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@5" | ||
| }, | ||
| "flags": 0, | ||
| "position": 77 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "ASC", | ||
| "value": "ASC", | ||
| "keyword": "ASC", | ||
| "type": { | ||
| "@type": "@3" | ||
| }, | ||
| "flags": 3, | ||
| "position": 78 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": ")", | ||
| "value": ")", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@18" | ||
| }, | ||
| "flags": 16, | ||
| "position": 81 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": ";", | ||
| "value": ";", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\TokenType", | ||
| "name": "Delimiter", | ||
| "value": 9 | ||
| }, | ||
| "flags": 0, | ||
| "position": 82 | ||
| }, | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Token", | ||
| "token": "", | ||
| "value": "", | ||
| "keyword": null, | ||
| "type": { | ||
| "@type": "@27" | ||
| }, | ||
| "flags": 0, | ||
| "position": null | ||
| } | ||
| ] | ||
| }, | ||
| "delimiter": ";", | ||
| "delimiterLen": 1 | ||
| }, | ||
| "parser": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Parser", | ||
| "strict": false, | ||
| "errors": [], | ||
| "list": { | ||
| "@type": "@1" | ||
| }, | ||
| "statements": [ | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Statements\\AlterStatement", | ||
| "table": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", | ||
| "database": null, | ||
| "table": "bad_table_is_bad", | ||
| "column": null, | ||
| "expr": "`bad_table_is_bad`", | ||
| "alias": null, | ||
| "function": null, | ||
| "subquery": null | ||
| }, | ||
| "altered": [ | ||
| { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Components\\AlterOperation", | ||
| "options": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", | ||
| "options": { | ||
| "1": "ADD", | ||
| "2": "UNIQUE KEY" | ||
| } | ||
| }, | ||
| "field": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression", | ||
| "database": null, | ||
| "table": null, | ||
| "column": "column1", | ||
| "expr": "`column1`", | ||
| "alias": null, | ||
| "function": null, | ||
| "subquery": null | ||
| }, | ||
| "partitions": null, | ||
| "unknown": [ | ||
| { | ||
| "@type": "@17" | ||
| }, | ||
| { | ||
| "@type": "@19" | ||
| }, | ||
| { | ||
| "@type": "@20" | ||
| }, | ||
| { | ||
| "@type": "@21" | ||
| }, | ||
| { | ||
| "@type": "@22" | ||
| }, | ||
| { | ||
| "@type": "@23" | ||
| }, | ||
| { | ||
| "@type": "@24" | ||
| }, | ||
| { | ||
| "@type": "@25" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "options": { | ||
| "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray", | ||
| "options": { | ||
| "3": "TABLE" | ||
| } | ||
| }, | ||
| "first": 0, | ||
| "last": 20 | ||
| } | ||
| ], | ||
| "brackets": 0 | ||
| }, | ||
| "errors": { | ||
| "lexer": [], | ||
| "parser": [] | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| ALTER TABLE `bad_table_is_bad` ADD UNIQUE KEY `column1` (`column1`,`column2` DESC); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is test files missing here
Also, maybe add an
col1 ASC, col2 DESCtest?