From b337d4d4d94217185bdba97e81ad9985a1139d05 Mon Sep 17 00:00:00 2001 From: Fariha Shaikh Date: Wed, 28 Jan 2026 23:40:06 +0000 Subject: [PATCH] MDEV-36725 Fix innodb_ctype_ldml test in view-protocol mode The test innodb.innodb_ctype_ldml was failing in view-protocol mode due to different column naming behavior for complex expressions. Without explicit column aliases, view-protocol mode generates automatic names (Name_exp_1, Name_exp_2) while normal mode uses the full expression as the column name. Add explicit column aliases to SELECT statements in innodb_ctype_ldml to ensure consistent column names across both normal and view-protocol modes. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- mysql-test/suite/innodb/r/innodb_ctype_ldml.result | 12 ++++++------ mysql-test/suite/innodb/t/innodb_ctype_ldml.test | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result index 82679961d6826..58fde387661ab 100644 --- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result +++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result @@ -469,11 +469,11 @@ show collation like 'utf8mb3_phone_ci'; Collation Charset Id Default Compiled Sortlen utf8mb3_phone_ci utf8mb3 352 8 SET NAMES utf8; -SELECT hex(weight_string(_utf8mb4'a' collate utf8mb4_test_400_ci)); -hex(weight_string(_utf8mb4'a' collate utf8mb4_test_400_ci)) +SELECT hex(weight_string(_utf8mb4'a' collate utf8mb4_test_400_ci)) AS hex_ws; +hex_ws 0E33 -SELECT hex(weight_string(convert(_utf32 0x10002 using utf8mb4) collate utf8mb4_test_400_ci)); -hex(weight_string(convert(_utf32 0x10002 using utf8mb4) collate utf8mb4_test_400_ci)) +SELECT hex(weight_string(convert(_utf32 0x10002 using utf8mb4) collate utf8mb4_test_400_ci)) AS hex_ws; +hex_ws FFFD SELECT hex(@a:=convert(_utf32 0x10400 using utf8mb4) collate utf8mb4_test_400_ci), hex(lower(@a)); hex(@a:=convert(_utf32 0x10400 using utf8mb4) collate utf8mb4_test_400_ci) hex(lower(@a)) @@ -949,9 +949,9 @@ HEX(WEIGHT_STRING(a)) HEX(CONVERT(a USING ucs2)) HEX(a) 15D3 09B809CD E0A6B8E0A78D 15D4 09B909CD E0A6B9E0A78D SELECT HEX(WEIGHT_STRING(a)) as wa, -GROUP_CONCAT(HEX(CONVERT(a USING ucs2)) ORDER BY LENGTH(a), BINARY a) +GROUP_CONCAT(HEX(CONVERT(a USING ucs2)) ORDER BY LENGTH(a), BINARY a) AS gc FROM t1 GROUP BY a ORDER BY a; -wa GROUP_CONCAT(HEX(CONVERT(a USING ucs2)) ORDER BY LENGTH(a), BINARY a) +wa gc 15A2 0985 15A3 0986 15A4 0987 diff --git a/mysql-test/suite/innodb/t/innodb_ctype_ldml.test b/mysql-test/suite/innodb/t/innodb_ctype_ldml.test index 90e7f89d7fd6b..1dd9bcf673df1 100644 --- a/mysql-test/suite/innodb/t/innodb_ctype_ldml.test +++ b/mysql-test/suite/innodb/t/innodb_ctype_ldml.test @@ -181,10 +181,12 @@ create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci); show create table t1; insert into t1 values (0x0061); +--disable_view_protocol --enable_metadata set @@character_set_results=NULL; select * from t1; --disable_metadata +--enable_view_protocol drop table t1; # @@ -204,8 +206,8 @@ show collation like 'utf8mb3_phone_ci'; SET NAMES utf8; # make sure utf8mb4_test_400_ci is Unicode-4.0.0 based -SELECT hex(weight_string(_utf8mb4'a' collate utf8mb4_test_400_ci)); -SELECT hex(weight_string(convert(_utf32 0x10002 using utf8mb4) collate utf8mb4_test_400_ci)); +SELECT hex(weight_string(_utf8mb4'a' collate utf8mb4_test_400_ci)) AS hex_ws; +SELECT hex(weight_string(convert(_utf32 0x10002 using utf8mb4) collate utf8mb4_test_400_ci)) AS hex_ws; SELECT hex(@a:=convert(_utf32 0x10400 using utf8mb4) collate utf8mb4_test_400_ci), hex(lower(@a)); SELECT hex(@a:=convert(_utf32 0x10428 using utf8mb4) collate utf8mb4_test_400_ci), hex(upper(@a)); SELECT hex(@a:=convert(_utf32 0x2C00 using utf8mb4) collate utf8mb4_test_400_ci), hex(lower(@a)); @@ -342,7 +344,7 @@ INSERT INTO t1 VALUES SELECT HEX(WEIGHT_STRING(a)), HEX(CONVERT(a USING ucs2)), HEX(a) FROM t1 ORDER BY a, BINARY(a); SELECT HEX(WEIGHT_STRING(a)) as wa, -GROUP_CONCAT(HEX(CONVERT(a USING ucs2)) ORDER BY LENGTH(a), BINARY a) +GROUP_CONCAT(HEX(CONVERT(a USING ucs2)) ORDER BY LENGTH(a), BINARY a) AS gc FROM t1 GROUP BY a ORDER BY a; DROP TABLE t1;