Skip to content

Add MySQL auto-user deletion#33520

Merged
gabrielcorado merged 4 commits intomasterfrom
gabrielcorado/mysql-user-auto-deletion
Oct 17, 2023
Merged

Add MySQL auto-user deletion#33520
gabrielcorado merged 4 commits intomasterfrom
gabrielcorado/mysql-user-auto-deletion

Conversation

@gabrielcorado
Copy link
Copy Markdown
Contributor

Implements auto-user deletion for MySQL databases.

MySQL DROP USER execution fails if the user is the DEFINER of a procedure or a view:

As of MySQL 8.0.22, DROP USER fails with an error if any account to be dropped is named as the DEFINER attribute for any stored object. (That is, the statement fails if dropping an account would cause a stored object to become orphaned.) - https://dev.mysql.com/doc/refman/8.0/en/drop-user.html

Given this, the MySQL auto-user deletion follows the same as the PostgreSQL one: it tries to drop the user and deactivates the user if it fails.

@gabrielcorado gabrielcorado self-assigned this Oct 16, 2023
@github-actions github-actions Bot added database-access Database access related issues and PRs size/md labels Oct 16, 2023
Copy link
Copy Markdown
Contributor

@greedy52 greedy52 left a comment

Choose a reason for hiding this comment

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

lol, lets see if this PR will get merged first or the MariaDB change. 😈

Base automatically changed from gabrielcorado/pg-user-auto-deletion to master October 16, 2023 17:29
@gabrielcorado gabrielcorado force-pushed the gabrielcorado/mysql-user-auto-deletion branch from 9ab3cda to 9492992 Compare October 16, 2023 22:06
Copy link
Copy Markdown
Contributor

@fspmarshall fspmarshall left a comment

Choose a reason for hiding this comment

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

lgtm, but take that with a grain of salt. I don't know much about sql.

@gabrielcorado gabrielcorado added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2023
@gabrielcorado gabrielcorado added this pull request to the merge queue Oct 17, 2023
Merged via the queue into master with commit 00ab142 Oct 17, 2023
@gabrielcorado gabrielcorado deleted the gabrielcorado/mysql-user-auto-deletion branch October 17, 2023 21:28
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gabrielcorado See the table below for backport results.

Branch Result
branch/v14 Failed

gabrielcorado added a commit that referenced this pull request Oct 19, 2023
* feat(mysql): add auto-user deletion

* chore(mysql): remove unused deletion variables

* test(mysql): fix race condition
github-merge-queue Bot pushed a commit that referenced this pull request Oct 20, 2023
* feat(mysql): add auto-user deletion

* chore(mysql): remove unused deletion variables

* test(mysql): fix race condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database-access Database access related issues and PRs size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants