fix: mysql user create if not exists error - #1412
Conversation
|
@Kelketek This was kind of insane that I didn't believe no one has run into this before, so I took a look.
If anyone like me doesn't want to spend that time confirming this using Tutor, this file contains the steps to reproduce the same issue in a standalone docker container - Running the same experiment using a MySQL 8.4 container returns cleanly. |
10eaf2e to
a79ef7e
Compare
|
@tecoholic Done. Thank you for digging further into that-- it makes sense why others may not have hit it yet. |
|
I think this change is not needed as current MySQL version on release branch when setting up Tutor is 8.4.11 (See here) |
|
@muhammadadeeltajamul This bugfix was for Tutor instances that used MySQL 8.0 from other sources like managed cloud DB service, and not for the one bundled by default with Tutor. As I mentioned in my earlier comment it's not commonly occurring and requires specific setup to reproduce locally. DigitalOcean for example made MySQL 8.4 available in their managed DB offering only on May 2026. So the instances deployed earlier all had to use Mysql 8.0 and would run into issues. |
|
@muhammadadeeltajamul Just a ping here. Can you take another look in light of @tecoholic 's comment? |
Description
This pull request fixes an issue where MySQL may choke on the 'create user if not exists' command in the case that a user has a view that they have created. This is a bug in MySQL that has existed for at least a few years: https://bugs.mysql.com/bug.php?id=107139
The bug is more likely to occur in some managed database environments where the provided 'admin user' does not have the "SET_USER_ID" privilege. This is the case, for instance, with DigitalOcean. It may also happen for reasons not yet fully understood even if this privilege is available.
Supporting information
Internal ticket: https://tasks.opencraft.com/browse/BB-10998
Edx-Enterprise migration which creates a view: https://github.com/openedx/edx-enterprise/blob/master/enterprise/migrations/0236_create_vw_enterprise_customer_ecus_pecus.py
Testing instructions
... as needed.