From cfa614345358c7ad54abd4a23331d65ef0aba6f4 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 19 Jun 2024 10:01:30 +0400 Subject: [PATCH] MDEV-27966 Assertion `fixed()' failed and Assertion `fixed == 1' failed, both in Item_func_concat::val_str on SELECT after INSERT with collation utf32_bin on utf8_bin table This problem was earlier fixed by this commit: > commit 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 > Author: Aleksey Midenkov > Date: Mon Apr 18 12:44:27 2022 +0300 > > MDEV-24176 Server crashes after insert in the table with virtual > column generated using date_format() and if() Adding an mtr test only. --- mysql-test/suite/vcol/r/vcol_utf32.result | 37 +++++++++++++++++++++++ mysql-test/suite/vcol/t/vcol_utf32.test | 18 +++++++++++ 2 files changed, 55 insertions(+) create mode 100644 mysql-test/suite/vcol/r/vcol_utf32.result create mode 100644 mysql-test/suite/vcol/t/vcol_utf32.test diff --git a/mysql-test/suite/vcol/r/vcol_utf32.result b/mysql-test/suite/vcol/r/vcol_utf32.result new file mode 100644 index 00000000000..202c9da40f0 --- /dev/null +++ b/mysql-test/suite/vcol/r/vcol_utf32.result @@ -0,0 +1,37 @@ +# +# MDEV-27966 Assertion `fixed()' failed and Assertion `fixed == 1' failed, both in Item_func_concat::val_str on SELECT after INSERT with collation utf32_bin on utf8_bin table +# +SET NAMES utf8mb3; +SET sql_mode=''; +CREATE TABLE t (c1 INT,c2 CHAR AS (CONCAT ('',DAYNAME ('')))) COLLATE utf8_bin ENGINE=InnoDB; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't' +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +Warnings: +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +Warning 1906 The value specified for generated column 'c2' in table 't' has been ignored +Warning 1292 Incorrect datetime value: '' +SET collation_connection='utf32_bin'; +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +ERROR HY000: Illegal mix of collations (utf8_bin,COERCIBLE) and (utf32_bin,COERCIBLE) for operation 'concat' +SELECT * FROM t; +ERROR HY000: Illegal mix of collations (utf8_bin,COERCIBLE) and (utf32_bin,COERCIBLE) for operation 'concat' +DROP TABLE t; +SET sql_mode=DEFAULT; +SET NAMES utf8mb3; diff --git a/mysql-test/suite/vcol/t/vcol_utf32.test b/mysql-test/suite/vcol/t/vcol_utf32.test new file mode 100644 index 00000000000..a8a116201de --- /dev/null +++ b/mysql-test/suite/vcol/t/vcol_utf32.test @@ -0,0 +1,18 @@ +--source include/have_utf32.inc + +--echo # +--echo # MDEV-27966 Assertion `fixed()' failed and Assertion `fixed == 1' failed, both in Item_func_concat::val_str on SELECT after INSERT with collation utf32_bin on utf8_bin table +--echo # + +SET NAMES utf8mb3; +SET sql_mode=''; +CREATE TABLE t (c1 INT,c2 CHAR AS (CONCAT ('',DAYNAME ('')))) COLLATE utf8_bin ENGINE=InnoDB; +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +SET collation_connection='utf32_bin'; +--error ER_CANT_AGGREGATE_2COLLATIONS +INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); +--error ER_CANT_AGGREGATE_2COLLATIONS +SELECT * FROM t; +DROP TABLE t; +SET sql_mode=DEFAULT; +SET NAMES utf8mb3;