-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[11.x] MySQL transaction isolation level fix #50689
[11.x] MySQL transaction isolation level fix #50689
Conversation
This is incorrect. It already runs |
What version of mysql are you using? |
Oh man, it does seem the transaction isolation level is a special beast. |
8.3. The current code concatenates all the "SET" statement into a single statement, which does not work for the isolation level.
This results in a SQL error: |
Setting only the |
Anyhow, any fix that works fine is appreciated. Just bumped into this while checking the requirements to upgrade a project to 11.x and this at least made the tests pass |
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 agree this looks correct, after digging around. It seems MySQL implemented transaction isolation level differently to everything else, it's the one thing I didn't manually test, and its rarely used which is why we managed to get this far with nobody noticing.
Assumed that it's not a widely used scenario, and it's mostly only used while running tests in our case (where we kindof need to see the uncommitted data, as all tests run in a transaction) |
You run multiple php processes that both need the same data? Transactions can read their own writes without changing the isolation level. Moreover, the uncommitted isolation level makes it possible for transactions to not actually be able to read their own writes in some situations. |
Let's just say "it's complicated". There are several systems involved and some of the tests are more if the integration test kind, where a different component in a separate thread/container/whatever expects the data to be in the DB (which it will not be, as the original transaction is not committed). Then again, setting the default DB value to |
Should fix #50688