Database Collation plan

Created on 3 December 2021, almost 3 years ago
Updated 16 January 2024, 10 months ago

Problem/Motivation

Mysql uses a case-insensitive collation as a default, and then relies on the binary flag to determine if a column MUST be case-sensitive. Both SQLite and Postgres use case-insensitive for everything. There’s no reason SQL Server shouldn’t be able to operate either way.

If the database is case-sensitive, there are 2 errors, SelectSubqueryTest::testNotExistsSubquerySelect for example, when comparing fields of differing collations.

If the database is case-insensitive, there are 4 errors and several failures. migrateurlaliastest::testUrlAlias And FilterStringTest::testFilterStringContains
These are due to the LIKE operator. Postgres replaces LIKE with ILIKE to do case-insensitive matches. Maybe rewriting a LIKE b To UPPER(a) LIKE UPPER(b) Is the fix.

Steps to reproduce

Proposed resolution

Figure out the best collation, or better yet, ensure the driver can run on either.

Currently the installer checks that a CI collation is set as the default.

Options are, have the database one or the other, and/or manually setting each column collation while creating tables.

SQL Server uses uppercase for INFORMATION_SCHEMA.TABLES. Drupal has this in lowercase within the core Schema class, which necessitates rewriting a method if the DB default is set to CS.

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Active

Version

4.4

Component

Code

Created by

🇺🇸United States Beakerboy Kentucky

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