Skip to content

Commit

Permalink
Proposal for a fix of phpmyadmin#580.
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe- committed Sep 4, 2024
1 parent 91d980a commit 0774027
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 34 deletions.
5 changes: 4 additions & 1 deletion src/Components/AlterOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ class AlterOperation extends Component
'BY' => 2,
'FOREIGN' => 2,
'FULLTEXT' => 2,
'KEY' => 2,
'KEY' => [
2,
'var',
],
'KEYS' => 2,
'PARTITION' => 2,
'PARTITION BY' => 2,
Expand Down
18 changes: 7 additions & 11 deletions tests/data/bugs/gh317.out
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,15 @@
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD",
"2": "KEY"
"2": {
"name": "KEY",
"equals": false,
"expr": "`IDX_REPAIR`",
"value": "IDX_REPAIR"
}
}
},
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "IDX_REPAIR",
"expr": "`IDX_REPAIR`",
"alias": null,
"function": null,
"subquery": null
},
"field": null,
"partitions": null,
"unknown": [
{
Expand Down
18 changes: 7 additions & 11 deletions tests/data/parser/parseAlter.out
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,15 @@
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD",
"2": "KEY"
"2": {
"name": "KEY",
"equals": false,
"expr": "`idx_actor_last_name`",
"value": "idx_actor_last_name"
}
}
},
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "idx_actor_last_name",
"expr": "`idx_actor_last_name`",
"alias": null,
"function": null,
"subquery": null
},
"field": null,
"partitions": null,
"unknown": [
{
Expand Down
18 changes: 7 additions & 11 deletions tests/data/parser/parsephpMyAdminExport1.out
Original file line number Diff line number Diff line change
Expand Up @@ -5480,19 +5480,15 @@
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
"options": {
"1": "ADD",
"2": "KEY"
"2": {
"name": "KEY",
"equals": false,
"expr": "`INDEX_totalTime`",
"value": "INDEX_totalTime"
}
}
},
"field": {
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
"database": null,
"table": null,
"column": "INDEX_totalTime",
"expr": "`INDEX_totalTime`",
"alias": null,
"function": null,
"subquery": null
},
"field": null,
"partitions": null,
"unknown": [
{
Expand Down

0 comments on commit 0774027

Please sign in to comment.