Problem

The SQlite Schema implementation does not quote the names of indexes. The MySQL implementation does, so there are now contrib modules that work using MySQL, but not when using SQlite.

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

The SQlite schema object should quote the index name just like the MySQL schema object already does.

CommentFileSizeAuthor
drupal-sqlite-quote-indexes.patch2.09 KBjsst

Comments

jsst created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, drupal-sqlite-quote-indexes.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

daffie’s picture

Hi @jsst: Thanks for posting the patch.

#2986452: Database reserved keywords need to be quoted as per the ANSI standard has landed. The quoting of index names needs to happen in the same way. Also there needs to automated testing to make sure that the fix fixes the problem and that somebody else in the future does not undo the added fix.

daffie’s picture

Status: Needs work » Closed (duplicate)