1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-3798: EXPLAIN UPDATE/DELETE

Update the SHOW EXPLAIN code to work with the 
new architecture (part#1):
Before, SHOW EXPLAIN operated on real query plan structures, 
which meant it had to check when SELECTs are created/deleted.
SELECTs would call apc_target->enable() when they got a query 
plan and disable() when their query plan was deleted.

Now, Explain data structure becomes available at once (and we
call apc_target->enable()) and then it stays until it is deleted
(when that happens, we call apc_target->disable()).
This commit is contained in:
Sergey Petrunya
2013-10-14 20:09:33 +04:00
parent f67f8fd00f
commit 105e3ae6c9
11 changed files with 76 additions and 45 deletions

View File

@ -181,6 +181,8 @@ set debug_dbug='+d,show_explain_probe_join_exec_start';
set @foo= (select max(a) from t0 where sin(a) >0);
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
ERROR 70100: Query execution was interrupted
set debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for an UPDATE
@ -405,13 +407,8 @@ set debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM v1, t2;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
a b
8 4
8 5
8 6
8 7
8 8
8 9
kill query $thr2;
ERROR 70100: Query execution was interrupted
set debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;

View File

@ -224,7 +224,9 @@ connection default;
--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
set debug_dbug=@old_debug;
@ -399,7 +401,9 @@ connection default;
--source include/wait_condition.inc
--error ER_TARGET_NOT_EXPLAINABLE
evalp show explain for $thr2;
evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
set debug_dbug=@old_debug;
DROP VIEW v1;