Skip to content
Snippets Groups Projects
Commit 2492b802 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2454733 followup by amateescu: Add a user-space case-insensitive...

Issue #2454733 followup by amateescu: Add a user-space case-insensitive collation to the SQLite driver
parent 98b74d2d
No related branches found
No related tags found
No related merge requests found
......@@ -553,8 +553,8 @@ public static function truncate($string, $max_length, $wordsafe = FALSE, $add_el
* Returns < 0 if $str1 is less than $str2; > 0 if $str1 is greater than
* $str2, and 0 if they are equal.
*/
public static function strCaseCmp($str1 , $str2) {
return strcmp(mb_strtoupper($str1, 'utf-8'), mb_strtoupper($str2, 'utf-8'));
public static function strcasecmp($str1 , $str2) {
return strcmp(static::strtoupper($str1), static::strtoupper($str2));
}
/**
......
......@@ -125,7 +125,7 @@ public static function open(array &$connection_options = array()) {
$pdo->sqliteCreateFunction('regexp', array(__CLASS__, 'sqlFunctionRegexp'));
// Create a user-space case-insensitive collation with UTF-8 support.
$pdo->sqliteCreateCollation('NOCASE_UTF8', array('Drupal\Component\Utility\Unicode', 'strCaseCmp'));
$pdo->sqliteCreateCollation('NOCASE_UTF8', array('Drupal\Component\Utility\Unicode', 'strcasecmp'));
// Execute sqlite init_commands.
if (isset($connection_options['init_commands'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment