Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Because of #2296557: [policy] Require PHP 5.5 I switched the PostgreSQL/SQLite bots at *.erwanderbar.de to test on PHP-5.5. This exposes a new fail in:
Drupal\system\Tests\Database\ConnectionTest 24 passes 1 fails
I never see this fail when on PHP-5.4.
Proposed resolution
Identify and fix the fail for both, PostgreSQL and SQLite.
Remaining tasks
Write Patch
User interface changes
None
API changes
?
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#4 | 2508777-4.patch | 806 bytes | dawehner |
Comments
Comment #1
daffie CreditAttribution: daffie commentedThe fail has to do with the not throwing of an exception when there are multiple statements in the executing of a single query.
Comment #2
bzrudi71 CreditAttribution: bzrudi71 commentedAh yes, thanks @daffie. I think we are hit by #2388255: (followup) Limit PDO MySQL to executing single statements if PHP supports it so adding as related.
[EDIT] Well, the actual work already started over in #2489672: Limit all DB drivers to executing single statements by checking for delimiter.
Comment #3
daffie CreditAttribution: daffie commentedBecause this issue is causing the SQLite database testbot to fail. And of what xjm said in #2454513-34: [meta] Make Drupal 8 work with SQLite:
I am setting the priority to critical.
Comment #4
dawehnerMeh, so yes this test should be just targeted against msyql.
I was wondering though whether sqlite and pgsql has similar kind of protection, see http://stackoverflow.com/questions/19253673/pdosqlite-does-not-run-multi... for example
@daffie
Do you have any information about that?
Comment #5
Crell CreditAttribution: Crell at Palantir.net commentedIt took me a moment to realize why this is needed, but it makes sense. The constant is defined regardless of whether the active DB is MySQL, so if using PGSQL or SQLite the constant is defined, we try to run a MySQL-specific test, and things break.
The change seems reasonable to me, given that it's a Simpletest class. We should still have someone confirm that it fixes things on SQLite/Postgres, though.
Comment #6
alexpottBecause we connect to Postgres and set this flag postgres can run mulitple queries in a single statement. See #2348931: Use native MySQL statement preparation via PDO. What is interesting about that issue is it asserts:
... and it has been this way since D7.
Anyhow this fix looks good for now. Committed bf44bc0 and pushed to 8.0.x. Thanks!
Comment #8
bzrudi71 CreditAttribution: bzrudi71 commentedWooho! I think we need a follow up here, created #2509296: PostgreSQL: Re-think current PDO::ATTR_EMULATE_PREPARES setting.