Skip to content

Add support for mysql's drop index (ALTER TABLE table_a DROP INDEX idx_a) #1865

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
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vimko
Copy link

@vimko vimko commented May 28, 2025

This PR adds support for mysql's drop index:

  • DROP INDEX idx_a ON table_a
  • ALTER TABLE table_a DROP INDEX idx_a

Addresses #1863

@iffyio
Copy link
Contributor

iffyio commented May 29, 2025

Thanks @vimko! fyi there's a similar PR here for DROP INDEX idx_a on table_a feature, we'll probably look to land that one and rebase this on top of it

@vimko
Copy link
Author

vimko commented May 29, 2025

@iffyio Indeed, I didn't notice that. Thank you very much for reminding me.

@vimko vimko changed the title Add support for mysql's drop index (DROP INDEX idx_a ON table_a and ALTER TABLE table_a DROP INDEX idx_a) Add support for mysql's drop index (ALTER TABLE table_a DROP INDEX idx_a) Jun 4, 2025
Comment on lines +192 to +193
/// Note: this is a [MySQL]-specific operation.
///
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Note: this is a [MySQL]-specific operation.
///

I think we can skip the note, since we're already linking to the mysql docs below

Comment on lines +9135 to +9137
// MySql dialect doesn't support `DROP INDEX idx_a`,you need to specify a specific table, please refer:
// [MySql](https://dev.mysql.com/doc/refman/8.4/en/drop-index.html)
match all_dialects_except(|d| d.is::<MySqlDialect>()).verified_stmt(sql) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I followed the intent here, from the code in this PR the parser doesnt seem to have started rejecting any DROP INDEX statement variants specifically for mysql, so that I imagined these should still have been passing for mysql?

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.

2 participants