drush
drush copied to clipboard
Ensure that that --db-prefix option works on Drupal 9
Fixes #4514
The breaking change in behaviour was because Drupal 9 changed how it handled quoted identifiers.
They were previously quoted in tildes (in MySQL), however they now use double-quotes, however in order for the tables and fields to run using double-quotes, the database must be running in a specific mode, specifically the ANSI_QUOTES mode. The ANSI_QUOTES mode is automatically set as part of the Drupal database's init_commands session prep command.
As part of the Drupal 9 support, I also added optional support for the new identifierQuotes feature under the --quote-identifier option.
Thanks for the thorough implementation and the tests. I really think Drupal is silly to keep supporting db-prefix. Nobody worries about how many DBs are on a server anymore. I hate to complicate sql:query by supporting it more.
One alternative is do a version of sql:query that bootstraps Drupal. That way init commands would be run because Drupals DB API would be running the query.
Undecided about what to do here so leaving it open for now.
I ran in to this issue today. Any chance we could get a possible timeline on this?
I don't have commit access to the repo to update the pullrequest, but if anyone is interested, here is the patch rerolled against 11.x