mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#1 - Changing collation derivation for string user variables from IMPLICIT to COERCIBLE. Retionale: Without this preparatory change, switching the default collation for Unicode character sets from xxx_general_ci to uca1400_ai_ci would cause "Illegal mix of collations" errors in scenarios comparing a column with a non-default collation to a string user variable This is especially important for queries to INFORMATION_SCHEMA tables, whose columns use utf8mb3_general_ci. See the description of MDEV-25829 for more details and SQL script examples.
This commit is contained in:
@ -859,11 +859,22 @@ REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2t
|
||||
1 this and that
|
||||
#
|
||||
# MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable
|
||||
#
|
||||
# Testing a warning
|
||||
#
|
||||
# Testing a warning
|
||||
SET NAMES latin1;
|
||||
SET @regCheck= '\\xE0\\x01';
|
||||
SELECT 0xE001 REGEXP @regCheck COLLATE latin1_bin;
|
||||
0xE001 REGEXP @regCheck COLLATE latin1_bin
|
||||
0
|
||||
Warnings:
|
||||
Warning 1139 Regex error 'UTF-8 error: 1 byte missing at end'
|
||||
SELECT 0xE001 REGEXP CAST(@regCheck AS CHAR);
|
||||
0xE001 REGEXP CAST(@regCheck AS CHAR)
|
||||
0
|
||||
Warnings:
|
||||
Warning 1139 Regex error 'UTF-8 error: 1 byte missing at end'
|
||||
# Since 11.4 user variables have DERIVATION_COERCIBLE
|
||||
# so a user variable and a literal in the pattern give equal results
|
||||
SET @regCheck= '\\xE0\\x01';
|
||||
SELECT 0xE001 REGEXP '\\xE0\\x01' AS c1, 0xE001 REGEXP @regCheck AS c2;
|
||||
c1 c2
|
||||
|
Reference in New Issue
Block a user