Commit 5b035c84 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-14572: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status...

MDEV-14572: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status upon EXPLAIN UPDATE in PS

Restore EXPAIN flag in SELECT_LEX before execution multi-update by flag in LEX
(the same but in other way made before INSERT/DELETE/SELECT)

Without it, mysql_update() didn't know that there will be EXPLAIN result set and was sending OK at the end of the update, which conflicted with the EOF sent later by EXPLAIN.
parent a8793a2c
......@@ -4397,5 +4397,22 @@ END;
1
1
#
# MDEV-14572: Assertion `! is_set()' failed in
# Diagnostics_area::set_eof_status upon EXPLAIN UPDATE in PS
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
PREPARE stmt FROM 'EXPLAIN UPDATE t1, t2 SET a = 1';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
deallocate prepare stmt;
DROP TABLE t1, t2;
#
# End of 10.1 tests
#
......@@ -3927,6 +3927,22 @@ END;
/
DELIMITER ;/
--echo #
--echo # MDEV-14572: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon EXPLAIN UPDATE in PS
--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
#EXPLAIN UPDATE t1, t2 SET a = 1;
PREPARE stmt FROM 'EXPLAIN UPDATE t1, t2 SET a = 1';
EXECUTE stmt;
EXECUTE stmt;
deallocate prepare stmt;
# Cleanup
DROP TABLE t1, t2;
--echo #
--echo # End of 10.1 tests
......
......@@ -3800,6 +3800,16 @@ mysql_execute_command(THD *thd)
else
res= 0;
/*
We can not use mysql_explain_union() because of parameters of
mysql_select in mysql_multi_update so just set the option if needed
*/
if (thd->lex->describe)
{
select_lex->set_explain_type(FALSE);
select_lex->options|= SELECT_DESCRIBE;
}
res= mysql_multi_update_prepare(thd);
#ifdef HAVE_REPLICATION
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment