MDEV-8554: Server crashes in base_list_iterator::next_fast ...
THD::>save_prep_leaf_list was set to true by multi-table update statements with mergeable selects and never reset. Make every statement reset it at start.
This commit is contained in:
parent
c4456b99b3
commit
193faa57e5
@ -5427,6 +5427,21 @@ View Create View character_set_client collation_connection
|
|||||||
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
|
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci
|
||||||
drop view v2;
|
drop view v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-8554: Server crashes in base_list_iterator::next_fast on 1st execution of PS with a multi-table update
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES (3),(4);
|
||||||
|
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t3 VALUES (5),(6);
|
||||||
|
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
|
||||||
|
PREPARE stmt FROM 'UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM t3 )';
|
||||||
|
UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM v3 );
|
||||||
|
EXECUTE stmt;
|
||||||
|
DROP TABLE t1, t2, t3;
|
||||||
|
DROP VIEW v3;
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# -- End of 5.5 tests.
|
# -- End of 5.5 tests.
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
@ -5380,6 +5380,27 @@ show create view v2;
|
|||||||
drop view v2;
|
drop view v2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-8554: Server crashes in base_list_iterator::next_fast on 1st execution of PS with a multi-table update
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES (1),(2); # Not necessary, the table can be empty
|
||||||
|
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES (3),(4); # Not necessary, the table can be empty
|
||||||
|
|
||||||
|
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t3 VALUES (5),(6); # Not necessary, the table can be empty
|
||||||
|
|
||||||
|
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
|
||||||
|
|
||||||
|
PREPARE stmt FROM 'UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM t3 )';
|
||||||
|
UPDATE t1, t2 SET a = 1 WHERE a IN ( SELECT 0 FROM v3 );
|
||||||
|
EXECUTE stmt;
|
||||||
|
|
||||||
|
DROP TABLE t1, t2, t3;
|
||||||
|
DROP VIEW v3;
|
||||||
|
|
||||||
--echo # -----------------------------------------------------------------
|
--echo # -----------------------------------------------------------------
|
||||||
--echo # -- End of 5.5 tests.
|
--echo # -- End of 5.5 tests.
|
||||||
--echo # -----------------------------------------------------------------
|
--echo # -----------------------------------------------------------------
|
||||||
|
@ -6269,6 +6269,8 @@ void THD::reset_for_next_command()
|
|||||||
thd->reset_current_stmt_binlog_format_row();
|
thd->reset_current_stmt_binlog_format_row();
|
||||||
thd->binlog_unsafe_warning_flags= 0;
|
thd->binlog_unsafe_warning_flags= 0;
|
||||||
|
|
||||||
|
thd->save_prep_leaf_list= false;
|
||||||
|
|
||||||
DBUG_PRINT("debug",
|
DBUG_PRINT("debug",
|
||||||
("is_current_stmt_binlog_format_row(): %d",
|
("is_current_stmt_binlog_format_row(): %d",
|
||||||
thd->is_current_stmt_binlog_format_row()));
|
thd->is_current_stmt_binlog_format_row()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user