You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a short session of digging into the sources, I found out this comes from the fact that, on AlterOperation.php, the TABLE_OPTIONS "KEY" is not allowing a variable by "INDEX" is. Therefore, I tried to allow a variable for "KEY" as well, but some unit tests were not passing because it changed some behavior beyond the variable being integrated in the options of the ADD alter operation: the field property became null.
As this is the behavior we have for the "INDEX" keyword usage for similar operation, I wonder if this shouldn't be fixed this way, but I also am afraid of BCBreak if some consumers of this package are expecting to have a "field" property set in such kind of operation.
If you want to parse
you'll get no trouble.
But if you want to parse
you'll have the error
while both of those operations are analoguous (see https://dev.mysql.com/doc/refman/8.4/en/alter-table.html).
After a short session of digging into the sources, I found out this comes from the fact that, on AlterOperation.php, the TABLE_OPTIONS "KEY" is not allowing a variable by "INDEX" is. Therefore, I tried to allow a variable for "KEY" as well, but some unit tests were not passing because it changed some behavior beyond the variable being integrated in the options of the
ADD
alter operation: the field property becamenull
.As this is the behavior we have for the "INDEX" keyword usage for similar operation, I wonder if this shouldn't be fixed this way, but I also am afraid of BCBreak if some consumers of this package are expecting to have a "field" property set in such kind of operation.
@williamdes what do you think?
Annexes
Here are different queries and, the actual status of the alter operation running in the parsed statement, with, to me, the expected status
ALTER TABLE acme ADD INDEX idx (col)
Actual
Expected: ✔️ same as actual.
ALTER TABLE acme ADD KEY idx (col)
Actual
Expected:
ALTER TABLE acme RENAME INDEX idx TO my_index
Actual
Expected: ✔️ same as actual.
ALTER TABLE acme RENAME KEY idx TO my_index
Actual
Parse error
Expected:
The text was updated successfully, but these errors were encountered: