mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#2 - Adding a new collation derivation level for CAST and CONVERT. Now character string cast functions: - CAST(string_expr AS CHAR) - CONVERT(expr USING charset_name) have a new collation derivation level between: - string literals - utf8 metadata functions, e.g. user() and database() Before the change these cast functions had collation derivation equal to table columns, which caused more illegal mix of collation conflicts. Note, binary string cast functions: - BINARY(expr) - CAST(string_expr AS BINARY) - CONVERT(expr USING binary) did not change their collation derivation, to preserve the behaviour of queries like these: SELECT database()=BINARY'test'; SELECT user()=CAST('root' AS BINARY); SELECT current_role()=CONVERT('role' USING binary); Derivation levels after the change look as follows: DERIVATION_IGNORABLE= 7, // Explicit NULL DERIVATION_NUMERIC= 6, // Numbers in string context, // Numeric user variables // CAST(numeric_expr AS CHAR) DERIVATION_COERCIBLE= 5, // Literals, string user variables DERIVATION_CAST= 4, // CAST(string_expr AS CHAR), // CONVERT(string_expr USING cs) DERIVATION_SYSCONST= 3, // utf8 metadata functions, e.g. user(), database() DERIVATION_IMPLICIT= 2, // Table columns, SP variables, BINARY(expr) DERIVATION_NONE= 1, // A mix (e.g. CONCAT) of two differrent collations DERIVATION_EXPLICIT= 0 // An explicit COLLATE clause
This commit is contained in:
@ -1477,10 +1477,10 @@ COERCIBILITY(NAME_CONST('name','test'))
|
||||
2
|
||||
SELECT COERCIBILITY(NAME_CONST('name',TIME'00:00:00'));
|
||||
COERCIBILITY(NAME_CONST('name',TIME'00:00:00'))
|
||||
5
|
||||
6
|
||||
SELECT COERCIBILITY(NAME_CONST('name',15));
|
||||
COERCIBILITY(NAME_CONST('name',15))
|
||||
5
|
||||
6
|
||||
SELECT CONCAT(NAME_CONST('name',15),'오');
|
||||
CONCAT(NAME_CONST('name',15),'오')
|
||||
15오
|
||||
|
Reference in New Issue
Block a user