summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2020-01-16 13:37:21 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2020-01-16 13:38:50 +0200
commit80bb7996eccfd0b842fd313be51b8faeed349ee9 (patch)
tree0c7a2b21ed2fe6f77bd85abeaf6ed7f4ca62ab42
parent409aba3d997e97287bc67467ef437164c9e70b96 (diff)
downloadmariadb-git-80bb7996eccfd0b842fd313be51b8faeed349ee9.tar.gz
MDEV-21210: main.uniques_crash-7912 tries to allocate 1TB of memorybb-5.5-vicentiu
Update uniques_crash-7912 to only cover 5GB of RAM and also work on unix.
-rw-r--r--mysql-test/r/uniques_crash-7912.result14
-rw-r--r--mysql-test/t/uniques_crash-7912.test22
2 files changed, 21 insertions, 15 deletions
diff --git a/mysql-test/r/uniques_crash-7912.result b/mysql-test/r/uniques_crash-7912.result
index bf3aab684ae..ed7db5b8ebd 100644
--- a/mysql-test/r/uniques_crash-7912.result
+++ b/mysql-test/r/uniques_crash-7912.result
@@ -1,11 +1,17 @@
+#
+# MDEV-7912
+#
+# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
+#
call mtr.add_suppression("Out of memory");
-set sql_mode="";
-drop table if exists t1,t2;
create table `t1` (`a` datetime not null) engine=InnoDB;
-create table `t2` (`a` int not null) engine=innodb;
+create table `t2` (`a` int not null) engine=InnoDB;
replace into t1 values (),();
insert into t2 values(0);
-set session sort_buffer_size = 1024*1024*1024*1024;
+#
+# sort_buffer_size must exceed 4GB to test the crash.
+#
+set session sort_buffer_size = 1024*1024*1024*5;
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
drop table t2;
drop table t1;
diff --git a/mysql-test/t/uniques_crash-7912.test b/mysql-test/t/uniques_crash-7912.test
index 8dc82f8f540..c325a97fd20 100644
--- a/mysql-test/t/uniques_crash-7912.test
+++ b/mysql-test/t/uniques_crash-7912.test
@@ -1,22 +1,22 @@
-#
-# MDEV-7912
-#
-# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
+--echo #
+--echo # MDEV-7912
+--echo #
+--echo # multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
+--echo #
--source include/have_innodb.inc
---source include/have_debug.inc
---source include/windows.inc
call mtr.add_suppression("Out of memory");
-set sql_mode="";
---disable_warnings
-drop table if exists t1,t2;
create table `t1` (`a` datetime not null) engine=InnoDB;
-create table `t2` (`a` int not null) engine=innodb;
+create table `t2` (`a` int not null) engine=InnoDB;
+--disable_warnings
replace into t1 values (),();
insert into t2 values(0);
-set session sort_buffer_size = 1024*1024*1024*1024;
+--echo #
+--echo # sort_buffer_size must exceed 4GB to test the crash.
+--echo #
+set session sort_buffer_size = 1024*1024*1024*5;
#Either fail with EE_OUTOFMEMORY, or succeed
--error 0 , 5
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;