Problem/Motivation
For database drivers that override an other database driver, such as https://www.drupal.org/project/pgsql_fallback, have to create their own implementation for backend overridden services. The PostgreSQL fallback driver has to create its own service for the pgsql.views.date_sql
service. This is problematic because the PostgreSQL fallback driver lives in a module and it is not enabled by default and therefor the backend overridden service does not exist until it is enabled.
Core now only uses the driver name to check for a backend overridden service. The PostgreSQL fallback driver has the driver name "PgsqlFallback", not "pgsql".
Proposed resolution
Make the backend overridable service discovery also check with for the Connection->databaseType()
service override when there is no override for Connection->driver()
service.
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
Comment | File | Size | Author |
---|---|---|---|
#2 | 3130973-2.patch | 4.54 KB | daffie |
Comments
Comment #2
daffie CreditAttribution: daffie commentedComment #3
plachComment #4
daffie CreditAttribution: daffie commentedComment #5
Ghost of Drupal PastYeah this looks good. Although the variable names have been changed, as far as I can see the first attempt will be for the service prefixed by the return value of the
driver()
method and then we are adding a new attempt for the return value ofdatabaseType
method. Core returns the same for both but there's no reason contrib should be similarly married -- but as we will see, the "large" drivers are. Makes sense.For the sake of completeness, there's a chance of BC break here but that chance is just astronomically, astronomically low.
driver
anddatabaseType
. mysql, pgsql, sqlite oracle, sqlsrv all return the same value here so all of these won't break. The highest chance here is something extending theFakeConnection
which the MongodbDriver did but that driver hasn't been updated for five years. So I will usefake
as the example. Observe the zero results at http://grep.xnddx.ru/search?text=fakeconnection&filename= as well.foo
andfake.foo
butfake.foo
was not intended as the override offoo
.This will break. Do we care? I think not.
Comment #6
catchCommitted 0e6ed37 and pushed to 9.1.x. Thanks!
I think this is probably OK to backport, but 9.0.x is frozen, and while there's very little chance for the conflict that chx describes, it is a behaviour change/API widening as opposed to a strict bug fix. So leaving RTBC against 9.0.x for now.
Comment #9
catchBackported to 9.0.x
Comment #11
quietone CreditAttribution: quietone at PreviousNext commentedPublished the CR