Problem/Motivation

In https://www.drupal.org/project/drupal/issues/3181013 there is an issue with configuration storage and we need a test that can simulate a failure of storage. It does this well by creating tables with invalid schema so queries fail.

However, with SQLite storage used for a lot of testing, there is an issue in that it uses double quoted identifiers. Even though the schema is wrong and we are selecting from invalid columns - the query succeeds. This appears to be normal behaviour for double quoted identifiers:

https://www.sqlite.org/lang_keywords.html
> If a keyword in double quotes (ex: "key" or "glob") is used in a context where it cannot be resolved to an identifier but where a string literal is allowed, then the token is understood to be a string literal instead of an identifier.

Steps to reproduce

-

Proposed resolution

Change the identifiers to be either square brackets (MS Access compatibility) or grace accents (MySQL compatibility).
Although these are non-SQL conformant and for compatibility purposes - it's the only way to prevent a quoted identified from being treated as a string literal, and the only way I can currently think to allow us to write the tests needed for the above issue.

Remaining tasks

* Change identifierQuotes on the SQLite connection to square brackets
* Is a test required? I would anticipate as its configuration, it's not needed, and any regression here would begin failing the above issues tests if it was unblocked

User interface changes

None

API changes

Hopefully none, as this is in the driver layer, but arguably impacts all queries.

Data model changes

None

Release notes snippet

TBD

Comments

Driskell created an issue. See original summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.