mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
MDEV-5148: Server crashes in print_explain on killing EXPLAIN EXTENDED
- Make mysql_select() return error when the query was killed.
This commit is contained in:
parent
5258e642cc
commit
60c55522c3
3 changed files with 56 additions and 4 deletions
|
|
@ -1166,6 +1166,22 @@ SUM(b)
|
|||
0
|
||||
set debug_dbug=@old_debug;
|
||||
DROP TABLE t1,t2;
|
||||
# End
|
||||
drop table t0;
|
||||
#
|
||||
# MDEV-5148: Server crashes in print_explain on killing EXPLAIN EXTENDED
|
||||
#
|
||||
create table t0 (a int not null);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 select a,a from t0;
|
||||
create table t2 as select * from t1;
|
||||
set @show_explain_probe_select_id=2;
|
||||
set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
|
||||
explain
|
||||
select * from t0
|
||||
where not exists ( select 1 from t1, t2 where t1.b=t2.b and t2.a=t0.a) and a is null;
|
||||
kill query $thr2;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
drop table t0,t1,t2;
|
||||
# End
|
||||
set debug_sync='RESET';
|
||||
|
|
|
|||
|
|
@ -1167,9 +1167,37 @@ reap;
|
|||
|
||||
set debug_dbug=@old_debug;
|
||||
DROP TABLE t1,t2;
|
||||
drop table t0;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5148: Server crashes in print_explain on killing EXPLAIN EXTENDED
|
||||
--echo #
|
||||
create table t0 (a int not null);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 select a,a from t0;
|
||||
|
||||
create table t2 as select * from t1;
|
||||
|
||||
set @show_explain_probe_select_id=2;
|
||||
set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
|
||||
send
|
||||
explain
|
||||
select * from t0
|
||||
where not exists ( select 1 from t1, t2 where t1.b=t2.b and t2.a=t0.a) and a is null;
|
||||
|
||||
connection default;
|
||||
--source include/wait_condition.inc
|
||||
evalp kill query $thr2;
|
||||
|
||||
connection con1;
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
reap;
|
||||
|
||||
drop table t0,t1,t2;
|
||||
|
||||
--echo # End
|
||||
drop table t0;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
set debug_sync='RESET';
|
||||
|
|
|
|||
|
|
@ -3200,7 +3200,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
|
|||
select_result *result, SELECT_LEX_UNIT *unit,
|
||||
SELECT_LEX *select_lex)
|
||||
{
|
||||
bool err;
|
||||
int err= 0;
|
||||
bool free_join= 1;
|
||||
DBUG_ENTER("mysql_select");
|
||||
|
||||
|
|
@ -3294,7 +3294,7 @@ err:
|
|||
err|= select_lex->cleanup();
|
||||
DBUG_RETURN(err || thd->is_error());
|
||||
}
|
||||
DBUG_RETURN(join->error);
|
||||
DBUG_RETURN(join->error ? join->error: err);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -7412,6 +7412,14 @@ best_extension_by_limited_search(JOIN *join,
|
|||
DBUG_ENTER("best_extension_by_limited_search");
|
||||
|
||||
THD *thd= join->thd;
|
||||
|
||||
DBUG_EXECUTE_IF("show_explain_probe_best_ext_lim_search",
|
||||
if (dbug_user_var_equals_int(thd,
|
||||
"show_explain_probe_select_id",
|
||||
join->select_lex->select_number))
|
||||
dbug_serve_apcs(thd, 1);
|
||||
);
|
||||
|
||||
if (thd->check_killed()) // Abort
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue