mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 15:55:53 +02:00
MDEV-33423: show_analyze sporadically fails at line 226: 'reap' succeeded...
Fix a race condition in a testcase: it tried to KILL a running SET query. The query could finish before KILL command killed it, which resulted in: query 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED Fixed by forcing the query to first block for SHOW ANALYZE and then block again waiting to be KILLed.
This commit is contained in:
parent
86c2c89743
commit
4ed8d98ba7
2 changed files with 15 additions and 5 deletions
|
|
@ -207,9 +207,12 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
|
|||
SET debug_dbug=@old_debug;
|
||||
# Try to do SHOW ANALYZE for a query that runs a SET command:
|
||||
#
|
||||
set @show_explain_probe_select_id=2;
|
||||
create table t2 (a int);
|
||||
insert into t2 values (1),(2);
|
||||
set @show_explain_probe_select_id=3;
|
||||
SET debug_dbug='+d,show_explain_probe_join_exec_start';
|
||||
set @foo= (select max(a) from t0 where sin(a) >0);
|
||||
set @foo= (select max(a) from t2
|
||||
where a + (select max(a) from t0 where t0.a>t2.a) < 10000);
|
||||
connection default;
|
||||
show analyze for $thr2;
|
||||
ERROR HY000: Target is not executing an operation with a query plan
|
||||
|
|
@ -217,6 +220,7 @@ kill query $thr2;
|
|||
connection con1;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
SET debug_dbug=@old_debug;
|
||||
drop table t2;
|
||||
#
|
||||
# Attempt SHOW ANALYZE for an UPDATE
|
||||
#
|
||||
|
|
|
|||
|
|
@ -213,9 +213,15 @@ SET debug_dbug=@old_debug;
|
|||
|
||||
--echo # Try to do SHOW ANALYZE for a query that runs a SET command:
|
||||
--echo #
|
||||
set @show_explain_probe_select_id=2; # <---
|
||||
create table t2 (a int);
|
||||
insert into t2 values (1),(2);
|
||||
set @show_explain_probe_select_id=3; # Stop in the subquery.
|
||||
SET debug_dbug='+d,show_explain_probe_join_exec_start';
|
||||
send set @foo= (select max(a) from t0 where sin(a) >0);
|
||||
# t2 has 2 rows so we will stop in the subquery twice:
|
||||
# - first one to serve the SHOW ANALYZE request
|
||||
# - second one when waiting to be KILLed.
|
||||
send set @foo= (select max(a) from t2
|
||||
where a + (select max(a) from t0 where t0.a>t2.a) < 10000);
|
||||
connection default;
|
||||
--source include/wait_condition.inc
|
||||
--error ER_TARGET_NOT_EXPLAINABLE
|
||||
|
|
@ -225,7 +231,7 @@ connection con1;
|
|||
--error ER_QUERY_INTERRUPTED
|
||||
reap;
|
||||
SET debug_dbug=@old_debug;
|
||||
|
||||
drop table t2;
|
||||
|
||||
--echo #
|
||||
--echo # Attempt SHOW ANALYZE for an UPDATE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue