-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Stop throwing exceptions on commit in PHP8+pdo_mysql combo #1131
Conversation
MySQL commits implicitly after every DDL query, but since PHP 8, mysql_pdo started to throw exception when attempting to explicitly commit after it implicitly committed. This causes to interrupt the migration process even though all queries completed successfully. Alternative would be to disable transaction for PHP8+pdo_mysql, but that would affect all queries, not only DDL ones like intended, hence going with guard check before each explicit commit. Hopefully this will be fixed directly in DBAL in future, but so far this doesn't look very likely...
FYI: @ostrolucky @greg0ire Seeing an odd I'm not sure why that only occurs with PGSQL and the Behat tests, and also only in the tests of our CMS and not even the underlying Flow Framework: That hints at that it might be very edge-case scenario, but still something behaves unexpectedly different now. I will try to find out more. |
I spent some time analyzing the cause. See neos/neos-development-collection#3311 (comment) for the steps I did. Edit: This hardly explains why the same doesn't happen in our Framework tests though, where we also should have applied migrations onto a freshly created schema. Anyway, the core thing is: The condition right now slightly changes commit behaviour outside of the scope of the original issue (PHP8+pdo_mysql). |
Summary
I didn't go with exception swallowing after all, because it turned out PDO has
inTransaction()
which works here.