Make Drupal\Core\Database\Schema work with reserved keywords for naming

Created on 24 April 2020, over 4 years ago
Updated 5 August 2023, over 1 year ago

Problem/Motivation

In ๐Ÿ› Database reserved keywords need to be quoted as per the ANSI standard Fixed we fixed working with reserved keywords for queries. For the class Drupal\Core\Database\Schema there is nothing done. In ๐Ÿ› MySQL >= 8.0.2 Bug: Exception during module activation because of reserved keyword "GROUPS" Closed: works as designed we have a problem with using sites with the "group" module on Drupal 8 with MySQL 8. The problem should be fixed for Drupal 9, only for queries not for the class Drupal\Core\Database\Schema.
In #3033043: SQlite index names not quoted โ†’ we have the problem: "An example of such a module is restrict_ip ( https://www.drupal.org/project/restrict_ip โ†’ ) which defines an index named 'type-path'. The index name is perfectly valid on both MySQL and SQlite."

Proposed resolution

Add testing for working with reserved keywords in combination with the class Drupal\Core\Database\Schema. Add fixes where necessary. All functionality that the Schema class offers needs testing with reserved keywords. The needed test functionality is:

  1. Create a table in the new schema;
  2. Add, change, and delete a primary key;
  3. Add, change and delete a unique key;
  4. Add, change and delete a non unique key;
  5. Add, change and delete a column/field;
  6. Do a table search;
  7. Rename a table;
  8. Insert data in the table;
  9. Update the data in the table;
  10. Merge the data in the table;
  11. Upsert data in the table;
  12. Delete data from the table;
  13. Truncate the data in the table;
  14. Drop the table;

Remaining tasks

TBD

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

TBD

๐Ÿ› Bug report
Status

Fixed

Version

9.5

Component
Databaseย  โ†’

Last updated about 13 hours ago

  • Maintained by
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands @daffie
Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands daffie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024