-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: fix drop role not work as expected in the show result. #29667
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
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.
LGTM but could you also check if there are more bugs like this?
@@ -1225,7 +1225,7 @@ func (e *SimpleExec) executeDropUser(ctx context.Context, s *ast.DropUserStmt) e | |||
|
|||
// begin a transaction to delete a user. | |||
sql.Reset() | |||
sqlexec.MustFormatSQL(sql, `DELETE FROM %n.%n WHERE Host = %? and User = %?;`, mysql.SystemDB, mysql.UserTable, user.Hostname, user.Username) | |||
sqlexec.MustFormatSQL(sql, `DELETE FROM %n.%n WHERE Host = %? and User = %?;`, mysql.SystemDB, mysql.UserTable, strings.ToLower(user.Hostname), user.Username) |
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.
I think there might be another case in line 680:
sqlexec.MustFormatSQL(sql, `DELETE IGNORE FROM %n.%n WHERE FROM_HOST=%? and FROM_USER=%? and TO_HOST=%? and TO_USER=%?`, mysql.SystemDB, mysql.RoleEdgeTable, role.Hostname, role.Username, user.Hostname, user.Username)
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.
I'm not sure if it needs to be modified. Because this is not the mysql.user table
, currently, create user
will lowercase hostname
, so I think all SQL involving mysql.user
hostname
should be changed to lowercase. I'm not sure about the other tables.
I added some other modifications, please help double confirm whether it is correct, thank you.
/run-integration-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2df1e20
|
/run-cherry-picker release-5.3 |
What problem does this PR solve?
Issue Number: close #29655
Problem Summary:
fix drop role not work as expected in the show result.
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note