Skip to content

Fix #430 - ALTER TABLE … RENAME COLUMN … TO … is not understood by the parser/linter #432

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

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

niconoe-
Copy link
Contributor

Fixes #430

I agree that this PR adds a specific management case for the RENAME COLUMN. If you find this too specific, you could try to give me hints on how to do this in a cleaner way, as I'm unsure this could be possible.

Thanks.

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (1ac927f) 97.04% compared to head (284ba3a) 97.07%.

❗ Current head 284ba3a differs from pull request most recent head 8b30047. Consider uploading reports for the commit 8b30047 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##              5.8.x     #432      +/-   ##
============================================
+ Coverage     97.04%   97.07%   +0.03%     
+ Complexity     2209     2182      -27     
============================================
  Files            69       69              
  Lines          5083     4999      -84     
============================================
- Hits           4933     4853      -80     
+ Misses          150      146       -4     
Impacted Files Coverage Δ
src/Components/AlterOperation.php 100.00% <100.00%> (ø)

... and 50 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@niconoe-
Copy link
Contributor Author

Failing checks are only due to unmodified files. I don't expect to fix them on this PR.

Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good !
Out of curiosity, what happens to a query that renames two columns and also renames an index ?
Is it possible ?
https://dev.mysql.com/doc/refman/8.0/en/alter-table.html

@williamdes williamdes added this to the 5.8.0 milestone Mar 13, 2023
@niconoe-
Copy link
Contributor Author

niconoe- commented Mar 13, 2023

Looks good ! Out of curiosity, what happens to a query that renames two columns and also renames an index ? Is it possible ? https://dev.mysql.com/doc/refman/8.0/en/alter-table.html

This worth a unit test to check 😆

On MySQL, it is possible and it works fine. But I don't know how the parser manages it.

@niconoe-
Copy link
Contributor Author

Unit tests added via a provider to easily add some more.

And after some tests, it appears that there was just an extra space in the builder but after a trim, everything works fine ;)

@williamdes williamdes changed the base branch from master to 5.8.x March 13, 2023 17:20
@williamdes
Copy link
Member

Ah, the base is not the right one. Can you rebase onto 5.8.x ?
Git is not happy with that, so manually you need to hard set onto 5.8.x and cherry-pick each commit and then git push --force when you are finished

@niconoe- niconoe- mentioned this pull request Mar 13, 2023
@niconoe-
Copy link
Contributor Author

niconoe- commented Mar 13, 2023

I wasn't able to hard set onto 5.8.x so I create a new PR (#433) from a branch that starts from 5.8.x and cherry-picks my (fixed-up) commits.

You can close this PR now, if #433 is OK for you.

@williamdes
Copy link
Member

I wasn't able to hard set onto 5.8.x so I create a new PR (#433) from a branch that starts from 5.8.x and cherry-picks my (fixed-up) commits.

You can close this PR now, if #433 is OK for you.

Well, let's keep this one ;)
What I did is reset hard to your other branch, and force push this one to it

@williamdes williamdes self-assigned this Mar 13, 2023
Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All green ✅

@williamdes williamdes changed the title Attempt to fix 430 Fix #430 - ALTER TABLE … RENAME COLUMN … TO … is not understood by the parser/linter Mar 13, 2023
williamdes added a commit that referenced this pull request Mar 13, 2023
Pull-request: #432

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes merged commit 8399efa into phpmyadmin:5.8.x Mar 13, 2023
@niconoe- niconoe- deleted the fix-430 branch June 21, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ALTER TABLE … RENAME COLUMN … TO … not understood by the parser/linter
2 participants