Problem/Motivation
Running the HHVM unit tests for Drupal 7, I found that the Transaction tests were passing, however with exceptions. Determining the exact tests failing pointed out that it was a group of tests involving DDL statements with transactions, while using a MySQL server.
The crux of the issue was that the Drupal tests were testing for savepoints in MySQL, after running a DDL statement. The MySQL documentation explicitly states that the active transaction is immediately committed when a DDL statement is run, hence the savepoints would no longer exist (raising the said errors.)
Proposed resolution
Later on in the test there is a branch that handles the situation where a database server does not support transactions. I propose wrapping all of the DDL+transaction tests in the block, instead of just testing ROLLBACK.
This also seems strange to me because why would we be testing for DDL+transactions if the server does not support it?
Remaining tasks
There might be some implications in the value supportsTransactionalDDL() returns. According to this test, it might mean that the database supports rolling back after DDL changes.
Comments
Comment #1
lowjoel commentedComment #3
lowjoel commentedUhh, do I need a separate ticket for the 7.x patch? The Test bot seems to be trying to apply the 7.x patch to 8.x
Comment #4
danblack commentedpatch looks good to me.
> do I need a separate ticket for the 7.x patch
No, after the 8.x is committed the target version for this issue can be changed (as I understand it)
Comment #5
damien tournoud commentedWe will need more information here.
Exceptions? Which ones? During or outside of the tests?
Does HHVM actually support synchronous destructors? This test passes on PHP, so we are looking at a runtime difference here that needs investigation.
The test itself is legit, it's just confirming that the transaction is silently committed. We catch the RELEASE SAVEPOINT exception in Connection::popCommittableTransactions().
Comment #6
lowjoel commentedYes, HHVM supports synchronous destructors. PHP passes because they aren't raising any exception.
I don't see popCommittableTransactions catching anything on D7. So this only affects D7, then...
Comment #7
danblack commentedComment #8
damien tournoud commentedDrupal 7 has some similar code in
DatabaseConnection_mysql::popCommittableTransactions().This looks like a HHVM compatibility issue. Most likely HHVM doesn't expose MySQL error code 1305 the same way that the real PDO does.
Comment #9
lowjoel commentedYup, I didn't see that bit of code. I'm switching my focus back to HHVM, I'll keep this thread posted.
Comment #10
lowjoel commentedI've traced it down, #2392 for HHVM. Thanks for the help.
Comment #11
lowjoel commented