Re: b657bc75f90: MDEV-25829 Change default collation to utf8mb4_1400_ai_ci
Hi, Alexander, On Mar 08, Alexander Barkov wrote:
revision-id: b657bc75f90 (mariadb-11.0.1-262-gb657bc75f90) parent(s): 8e5f41b3453 author: Alexander Barkov committer: Alexander Barkov timestamp: 2023-11-15 10:58:03 +0400 message:
MDEV-25829 Change default collation to utf8mb4_1400_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: - CAST(string_expr AS BINARY) - CONVERT(expr USING binary) did not change their collation derivation.
Why not? Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
Hello Serg, On 3/8/24 18:29, Sergei Golubchik wrote:
Hi, Alexander,
On Mar 08, Alexander Barkov wrote:
revision-id: b657bc75f90 (mariadb-11.0.1-262-gb657bc75f90) parent(s): 8e5f41b3453 author: Alexander Barkov committer: Alexander Barkov timestamp: 2023-11-15 10:58:03 +0400 message:
MDEV-25829 Change default collation to utf8mb4_1400_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: - CAST(string_expr AS BINARY) - CONVERT(expr USING binary) did not change their collation derivation.
Why not?
The new patch is here: https://github.com/MariaDB/server/commit/85c659860c0e4ea2408f1a47c71ee590f32... I added more comments into class Derivation, to make it clearer that BINARY(expr) is still DERIVATION_EXPLICIT. And added this text into the commit comment: <comment> 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); </comment> The BINARY side should still win after the change.
Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
participants (2)
-
Alexander Barkov
-
Sergei Golubchik