From 6891c4874a70685e6f6661fad2369d26007003c7 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 11 Apr 2022 17:30:28 +0300 Subject: MDEV-28269 Assertion `save_errno' in maria_write or ER_GET_ERRNO The issue was that the value of MARIA_FOUND_WRONG_KEY was a value that could be returned by ha_key_cmp. This was already fixed in MyISAM, now using the same fix in Aria: Setting the value to INT_MAX32, which should be impossible in any normal cases. I also fixed so that if there is a wrong key, we now get a proper error message and not an assert. --- mysql-test/suite/maria/maria.result | 12 ++++++++++++ mysql-test/suite/maria/maria.test | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'mysql-test/suite/maria') diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 2a0317d504d..baf57a0fee5 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2882,3 +2882,15 @@ key(c, a), unique(b) partition by hash (b); replace into t1 values (1, 0, 0), (2, 0, 0), (0, 0, 0); drop table t1; +# +# MDEV-28269 Assertion `save_errno' in maria_write or ER_GET_ERRNO +# +connect session1,localhost,root,,; +SET big_tables= on; +SET NAMES 'sjis'; +SELECT 'למטה' AS a UNION SELECT 'Wetter' AS a; +a +למט×? +Wetter +connection default; +disconnect session1; diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index e0d9d2addc7..6ab95a565b8 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -1430,7 +1430,7 @@ CREATE TABLE t1 ( ) ENGINE=aria DEFAULT CHARSET=utf8 PACK_KEYS=0; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---exec $MARIA_CHK -d $MYSQLD_DATADIR/test/t1 +--exec $MARIA_CHK -d --ignore-control-file $MYSQLD_DATADIR/test/t1 DROP TABLE t1; # Test warnings with transactional=1 with MyISAM @@ -2105,3 +2105,14 @@ partition by hash (b); replace into t1 values (1, 0, 0), (2, 0, 0), (0, 0, 0); # cleanup drop table t1; + +--echo # +--echo # MDEV-28269 Assertion `save_errno' in maria_write or ER_GET_ERRNO +--echo # + +connect (session1,localhost,root,,); +SET big_tables= on; +SET NAMES 'sjis'; +SELECT 'למטה' AS a UNION SELECT 'Wetter' AS a; +connection default; +disconnect session1; -- cgit v1.2.1