Skip to content

Commit a4477d2

Browse files
committed
Fix failing test cases for MDEV-7912 patch
1 parent a5fa434 commit a4477d2

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1+
call mtr.add_suppression("Out of memory");
12
set sql_mode="";
23
drop table if exists t1,t2;
3-
Warnings:
4-
Note 1051 Unknown table 't1'
5-
Note 1051 Unknown table 't2'
64
create table `t1` (`a` datetime not null) engine=InnoDB;
75
create table `t2` (`a` int not null) engine=innodb;
86
replace into t1 values (),();
9-
Warnings:
10-
Warning 1364 Field 'a' doesn't have a default value
117
insert into t2 values(0);
128
set session sort_buffer_size = 1024*1024*1024*1024;
13-
SET session debug_dbug= '+d,make_merge_buff_alloc_fail';
149
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
15-
ERROR HY000: Out of memory (Needed 2 bytes)
16-
SET SESSION debug_dbug=DEFAULT;
1710
drop table t2;
1811
drop table t1;

mysql-test/t/uniques_crash-7912.test

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
#
12
# MDEV-7912
3+
#
24
# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers
5+
36
--source include/have_innodb.inc
7+
--source include/have_debug.inc
8+
--source include/windows.inc
9+
10+
call mtr.add_suppression("Out of memory");
11+
412
set sql_mode="";
13+
--disable_warnings
514
drop table if exists t1,t2;
615
create table `t1` (`a` datetime not null) engine=InnoDB;
716
create table `t2` (`a` int not null) engine=innodb;
8-
917
replace into t1 values (),();
1018
insert into t2 values(0);
1119
set session sort_buffer_size = 1024*1024*1024*1024;
12-
SET session debug_dbug= '+d,make_merge_buff_alloc_fail';
13-
--error 5 #EE_OUTOFMEMORY
20+
#Either fail with EE_OUTOFMEMORY, or succeed
21+
--error 0 , 5
1422
delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a;
15-
SET SESSION debug_dbug=DEFAULT;
23+
--enable_warnings
1624

1725
drop table t2;
18-
drop table t1;
26+
drop table t1;

sql/uniques.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,6 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
608608
if (flush_io_cache(&file) || reinit_io_cache(&file, READ_CACHE, 0L, 0, 0))
609609
return 1;
610610
size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size;
611-
DBUG_EXECUTE_IF("make_merge_buff_alloc_fail",
612-
DBUG_SET("+d,simulate_out_of_memory"););
613611
if (!(merge_buffer = (uchar *)my_malloc(buff_sz, MYF(MY_WME))))
614612
return 1;
615613
if (buff_sz < (ulong) (full_size * (file_ptrs.elements + 1)))
@@ -739,8 +737,6 @@ bool Unique::get(TABLE *table)
739737
/* Not enough memory; Save the result to file && free memory used by tree */
740738
if (flush())
741739
return 1;
742-
DBUG_EXECUTE_IF("make_merge_buff_alloc_fail",
743-
DBUG_SET("+d,simulate_out_of_memory"););
744740
size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size;
745741
if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_WME))))
746742
return 1;

0 commit comments

Comments
 (0)