mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
e709eb9bf7
# Conflicts: # mysql-test/suite/galera/r/MW-388.result # mysql-test/suite/galera/t/MW-388.test # mysql-test/suite/innodb/r/truncate_inject.result # mysql-test/suite/innodb/t/truncate_inject.test # mysql-test/suite/rpl/r/rpl_stop_slave.result # mysql-test/suite/rpl/t/rpl_stop_slave.test # sql/sp_head.cc # sql/sp_head.h # sql/sql_lex.cc # sql/sql_yacc.yy # storage/xtradb/buf/buf0dblwr.cc
55 lines
1.8 KiB
Text
55 lines
1.8 KiB
Text
drop table if exists t0, t1;
|
|
SET @old_debug= @@session.debug;
|
|
set debug_sync='RESET';
|
|
connect con2, localhost, root,,;
|
|
connection con2;
|
|
connection default;
|
|
create table t0 (a int) engine=myisam;
|
|
insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
|
|
create table t1 (a int, b int, filler char(100), key(a), key(b));
|
|
insert into t1
|
|
select A.a+10*B.a + 10*C.a, A.a+10*B.a + 10*C.a, 'filler'
|
|
from t0 A, t0 B, t0 C;
|
|
#
|
|
# Test SHOW EXPLAIN for single-table DELETE
|
|
#
|
|
connection con2;
|
|
SET debug_dbug='+d,show_explain_probe_delete_exec_start';
|
|
delete from t1 where a<10 and b+1>1000;
|
|
connection default;
|
|
show explain for $thr2;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 range a a 5 NULL 1 Using where
|
|
Warnings:
|
|
Note 1003 delete from t1 where a<10 and b+1>1000
|
|
connection con2;
|
|
#
|
|
# Test SHOW EXPLAIN for multi-table DELETE
|
|
#
|
|
set @show_explain_probe_select_id=1;
|
|
SET debug_dbug='+d,show_explain_probe_do_select';
|
|
delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000;
|
|
connection default;
|
|
show explain for $thr2;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t0 ALL NULL NULL NULL NULL 8 Using where
|
|
1 SIMPLE t1 ref a a 5 test.t0.a 4 Using where
|
|
Warnings:
|
|
Note 1003 delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000
|
|
connection con2;
|
|
#
|
|
# Test SHOW EXPLAIN for single-table UPDATE
|
|
#
|
|
connection con2;
|
|
SET debug_dbug='+d,show_explain_probe_update_exec_start';
|
|
update t1 set filler='filler-data-2' where a<10 and b+1>1000;
|
|
connection default;
|
|
show explain for $thr2;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 range a a 5 NULL 1 Using where
|
|
Warnings:
|
|
Note 1003 update t1 set filler='filler-data-2' where a<10 and b+1>1000
|
|
connection con2;
|
|
drop table t0,t1;
|
|
SET debug_dbug=@old_debug;
|
|
set debug_sync='RESET';
|