mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#36443 Server crashes when executing insert when insert trigger on table
The crash appeared to be a result of allocating an instance of Discrete_interval automatically that that was referred in out-of-declaration scope. Fixed with correcting backing up and restoring scheme of auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying; added simulation code that forces executing those fixes of the former bug that targeted at master-and-slave having incompatible bug#33029-prone versions. mysql-test/suite/bugs/r/rpl_bug33029.result: new results file mysql-test/suite/bugs/t/rpl_bug33029.test: test merely checks no crash happens on slave. sql/slave.cc: forcing to execute special logics implemented for bug#33029 if simulate_bug33029 the debug option is set. sql/sql_class.cc: swaps of backed and the actual auto_inc_intervals_forced basing on shallow coping. sql/structs.h: Removing the deep _copy() and methods associated with it; adding methods to Discrete_intervals_list: private `=', copy constructor to prevent using; private set_members(); public copy_shallow(), swap(), get_{head, tail, current}(); empty_no_free() through set_members().
This commit is contained in:
15
mysql-test/suite/bugs/r/rpl_bug33029.result
Normal file
15
mysql-test/suite/bugs/r/rpl_bug33029.result
Normal file
@ -0,0 +1,15 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table `t1` (`id` int not null auto_increment primary key);
|
||||
create trigger `trg` before insert on `t1` for each row begin end;
|
||||
set @@global.debug="+d,simulate_bug33029";
|
||||
stop slave;
|
||||
start slave;
|
||||
insert into `t1` values ();
|
||||
select * from t1;
|
||||
id
|
||||
1
|
25
mysql-test/suite/bugs/t/rpl_bug33029.test
Normal file
25
mysql-test/suite/bugs/t/rpl_bug33029.test
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# Bug #36443 Server crashes when executing insert when insert trigger on table
|
||||
#
|
||||
# Emulating the former bug#33029 situation to see that there is no crash anymore.
|
||||
#
|
||||
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table `t1` (`id` int not null auto_increment primary key);
|
||||
create trigger `trg` before insert on `t1` for each row begin end;
|
||||
|
||||
sync_slave_with_master;
|
||||
set @@global.debug="+d,simulate_bug33029";
|
||||
|
||||
stop slave;
|
||||
start slave;
|
||||
|
||||
connection master;
|
||||
|
||||
insert into `t1` values ();
|
||||
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
|
Reference in New Issue
Block a user