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
When getting schema information from a mysql database, the Schema.php implementation relies on getPrefixInfo finding information on tables. also because of the implementation in findTables, for building a list of tables. However, because of the implementation, it only ever looks at the information for the default key.
Proposed resolution
?
Remaining tasks
Decide on an approach, review, commit.
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#3 | mysql_s_schema-2554241-2.patch | 703 bytes | neclimdul |
#3 | mysql_s_schema-2554241-2.1.patch | 678 bytes | neclimdul |
Comments
Comment #2
Crell CreditAttribution: Crell at Palantir.net commentedComment #3
neclimdul2 possible approaches. I don't know if its valid to rely on the values in getConnectionOptions or not.
Comment #4
Crell CreditAttribution: Crell at Palantir.net commentedOption 2 is definitely the better approach, no question.
Committers: The 703 KB patch from #3 is what is RTBC, not the other one. :-)
Comment #5
webchickHm. Not sure of a good way to test this, so let's go with the fix for now.
Committed and pushed mysql_s_schema-2554241-2.patch to 8.0.x. Thanks!
Comment #8
Dave ReidThis needs to be backported to Drupal 7 as well as per #2223073: Calling DatabaseSchema::getPrefixInfo() on a non-default connection returns the wrong database - write tests.
Comment #9
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedThe backport is happening in #2311305: Schema::getPrefixInfo() return value refers to the wrong database (with #2223073: Calling DatabaseSchema::getPrefixInfo() on a non-default connection returns the wrong database - write tests repurposed to be about adding tests, since there are some in the patches there but none were ever written here).