summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2020-01-17 00:46:40 +0300
committerSergei Petrunia <psergey@askmonty.org>2020-01-17 00:46:40 +0300
commite709eb9bf712006d070767629518f827cd2f6bed (patch)
tree103290899cbe2a67f78277e0e33486e51ef01717 /mysql-test/main
parentd531b4ee3a9bcd89a2fa6b49a2207eaf966f53e3 (diff)
parentb04429434ad1ee7f49d263762a560f4ff31dd111 (diff)
downloadmariadb-git-e709eb9bf712006d070767629518f827cd2f6bed.tar.gz
Merge branch '10.2' into 10.3
# 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
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/cache_temporal_4265.result3
-rw-r--r--mysql-test/main/cache_temporal_4265.test6
-rw-r--r--mysql-test/main/create_or_replace2.result4
-rw-r--r--mysql-test/main/create_or_replace2.test4
-rw-r--r--mysql-test/main/drop_bad_db_type.result6
-rw-r--r--mysql-test/main/drop_bad_db_type.test6
-rw-r--r--mysql-test/main/engine_error_in_alter-8453.result5
-rw-r--r--mysql-test/main/engine_error_in_alter-8453.test5
-rw-r--r--mysql-test/main/error_simulation.result11
-rw-r--r--mysql-test/main/error_simulation.test11
-rw-r--r--mysql-test/main/func_regexp_pcre_debug.result3
-rw-r--r--mysql-test/main/func_regexp_pcre_debug.test3
-rw-r--r--mysql-test/main/log_slow_debug.result4
-rw-r--r--mysql-test/main/log_slow_debug.test4
-rw-r--r--mysql-test/main/mdev6830.result2
-rw-r--r--mysql-test/main/mdev6830.test4
-rw-r--r--mysql-test/main/merge-big.result2
-rw-r--r--mysql-test/main/merge-big.test2
-rw-r--r--mysql-test/main/merge_debug.result2
-rw-r--r--mysql-test/main/merge_debug.test2
-rw-r--r--mysql-test/main/myisam_debug.result4
-rw-r--r--mysql-test/main/myisam_debug.test4
-rw-r--r--mysql-test/main/range_innodb.result3
-rw-r--r--mysql-test/main/range_innodb.test3
-rw-r--r--mysql-test/main/range_interrupted-13751.result4
-rw-r--r--mysql-test/main/range_interrupted-13751.test4
-rw-r--r--mysql-test/main/select_debug.result2
-rw-r--r--mysql-test/main/select_debug.test2
-rw-r--r--mysql-test/main/show_explain.result178
-rw-r--r--mysql-test/main/show_explain.test182
-rw-r--r--mysql-test/main/show_explain_non_select.result8
-rw-r--r--mysql-test/main/show_explain_non_select.test8
-rw-r--r--mysql-test/main/show_explain_ps.result5
-rw-r--r--mysql-test/main/show_explain_ps.test5
-rw-r--r--mysql-test/main/slowlog_enospace-10508.result5
-rw-r--r--mysql-test/main/slowlog_enospace-10508.test5
-rw-r--r--mysql-test/main/stat_tables-enospc.result5
-rw-r--r--mysql-test/main/stat_tables-enospc.test5
-rw-r--r--mysql-test/main/union_crash-714.result4
-rw-r--r--mysql-test/main/union_crash-714.test4
-rw-r--r--mysql-test/main/warnings_debug.result2
-rw-r--r--mysql-test/main/warnings_debug.test2
42 files changed, 278 insertions, 255 deletions
diff --git a/mysql-test/main/cache_temporal_4265.result b/mysql-test/main/cache_temporal_4265.result
index 7f215de43fb..1cda7004a6f 100644
--- a/mysql-test/main/cache_temporal_4265.result
+++ b/mysql-test/main/cache_temporal_4265.result
@@ -1,13 +1,12 @@
create table t1 (a date);
insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04');
-set debug_dbug='d,str_to_datetime_warn';
+SET STATEMENT debug_dbug='d,str_to_datetime_warn' for
select * from t1 where a > date_add('2000-01-01', interval 5 day);
a
2001-02-03
2002-03-04
Warnings:
Note 1003 2000-01-01
-set debug_dbug='';
drop table t1;
create table t1 (id int not null, ut timestamp(6) not null);
insert into t1 values(1, '2001-01-01 00:00:00.2');
diff --git a/mysql-test/main/cache_temporal_4265.test b/mysql-test/main/cache_temporal_4265.test
index c62f3c3c506..1af683c617b 100644
--- a/mysql-test/main/cache_temporal_4265.test
+++ b/mysql-test/main/cache_temporal_4265.test
@@ -5,9 +5,9 @@
create table t1 (a date);
insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04');
-set debug_dbug='d,str_to_datetime_warn';
-select * from t1 where a > date_add('2000-01-01', interval 5 day);
-set debug_dbug='';
+
+SET STATEMENT debug_dbug='d,str_to_datetime_warn' for
+ select * from t1 where a > date_add('2000-01-01', interval 5 day);
drop table t1;
#
diff --git a/mysql-test/main/create_or_replace2.result b/mysql-test/main/create_or_replace2.result
index 47431212492..6be0d46bdc1 100644
--- a/mysql-test/main/create_or_replace2.result
+++ b/mysql-test/main/create_or_replace2.result
@@ -4,9 +4,9 @@ drop table if exists t1;
SET @old_debug= @@session.debug;
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
-set debug_dbug='+d,send_kill_after_delete';
+SET debug_dbug='+d,send_kill_after_delete';
CREATE OR REPLACE TABLE t1 LIKE tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
SHOW TABLES;
Tables_in_test
t1
diff --git a/mysql-test/main/create_or_replace2.test b/mysql-test/main/create_or_replace2.test
index 199e5523811..80c8b635d8d 100644
--- a/mysql-test/main/create_or_replace2.test
+++ b/mysql-test/main/create_or_replace2.test
@@ -19,9 +19,9 @@ SET @old_debug= @@session.debug;
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
-set debug_dbug='+d,send_kill_after_delete';
+SET debug_dbug='+d,send_kill_after_delete';
CREATE OR REPLACE TABLE t1 LIKE tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
SHOW TABLES;
show create table t1;
--sync_slave_with_master
diff --git a/mysql-test/main/drop_bad_db_type.result b/mysql-test/main/drop_bad_db_type.result
index 1b691957877..ae6fe708e60 100644
--- a/mysql-test/main/drop_bad_db_type.result
+++ b/mysql-test/main/drop_bad_db_type.result
@@ -1,5 +1,5 @@
-SET @save_dbug = @@debug_dbug;
-set debug_dbug='+d,unstable_db_type';
+SET @saved_dbug = @@debug_dbug;
+SET debug_dbug='+d,unstable_db_type';
install soname 'ha_archive';
create table t1 (a int) engine=archive;
insert t1 values (1),(2),(3);
@@ -33,4 +33,4 @@ t1.frm
drop table t1;
db.opt
uninstall soname 'ha_archive';
-set debug_dbug=@save_dbug;
+SET debug_dbug=@saved_dbug;
diff --git a/mysql-test/main/drop_bad_db_type.test b/mysql-test/main/drop_bad_db_type.test
index 6a3ac6ae00f..ebc732104d3 100644
--- a/mysql-test/main/drop_bad_db_type.test
+++ b/mysql-test/main/drop_bad_db_type.test
@@ -7,8 +7,8 @@ if (!$HA_ARCHIVE_SO) {
let $mysqld_datadir= `select @@datadir`;
-SET @save_dbug = @@debug_dbug;
-set debug_dbug='+d,unstable_db_type';
+SET @saved_dbug = @@debug_dbug;
+SET debug_dbug='+d,unstable_db_type';
install soname 'ha_archive';
create table t1 (a int) engine=archive;
@@ -28,4 +28,4 @@ drop table t1;
--list_files $mysqld_datadir/test
uninstall soname 'ha_archive';
-set debug_dbug=@save_dbug;
+SET debug_dbug=@saved_dbug;
diff --git a/mysql-test/main/engine_error_in_alter-8453.result b/mysql-test/main/engine_error_in_alter-8453.result
index c5a3375f33c..2c823f83038 100644
--- a/mysql-test/main/engine_error_in_alter-8453.result
+++ b/mysql-test/main/engine_error_in_alter-8453.result
@@ -1,6 +1,7 @@
create table t1 (a int, b int);
-set debug_dbug='+d,external_lock_failure';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,external_lock_failure';
alter table t1 add column c int;
ERROR HY000: Got error 168 'KABOOM!' from MyISAM
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/engine_error_in_alter-8453.test b/mysql-test/main/engine_error_in_alter-8453.test
index c4600ec07fe..78e6de2d645 100644
--- a/mysql-test/main/engine_error_in_alter-8453.test
+++ b/mysql-test/main/engine_error_in_alter-8453.test
@@ -4,8 +4,9 @@
--source include/have_debug.inc
create table t1 (a int, b int);
-set debug_dbug='+d,external_lock_failure';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,external_lock_failure';
--error ER_GET_ERRMSG
alter table t1 add column c int;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/error_simulation.result b/mysql-test/main/error_simulation.result
index 7e728d24fc8..457e5c8ec9c 100644
--- a/mysql-test/main/error_simulation.result
+++ b/mysql-test/main/error_simulation.result
@@ -10,6 +10,7 @@ INSERT INTO t1 VALUES
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,raise_error";
SELECT MAX(a) FROM t1 GROUP BY a,b;
ERROR 23000: Can't write; duplicate key in table '(temporary)'
@@ -22,7 +23,7 @@ CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug_dbug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -42,7 +43,7 @@ CREATE TABLE t1(a BLOB);
SET SESSION debug_dbug="+d,bug42064_simulate_oom";
INSERT INTO t1 VALUES("");
Got one of the listed errors
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1;
#
# Bug#41660: Sort-index_merge for non-first join table may require
@@ -79,7 +80,7 @@ a a b filler
7 1 1 data
8 1 1 data
9 1 1 data
-SET SESSION debug_dbug= DEFAULT;
+SET debug_dbug= @saved_dbug;
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1, t2;
#
@@ -92,7 +93,7 @@ INSERT INTO t2 VALUES (1),(2);
SET SESSION debug_dbug="+d,bug11747970_raise_error";
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
ERROR 70100: Query execution was interrupted
-SET SESSION debug_dbug = DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1,t2;
#
# End of 5.1 tests
@@ -126,4 +127,4 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
SELECT f1(1);
Got one of the listed errors
DROP FUNCTION f1;
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/error_simulation.test b/mysql-test/main/error_simulation.test
index 1debed871c7..f713e2da6ba 100644
--- a/mysql-test/main/error_simulation.test
+++ b/mysql-test/main/error_simulation.test
@@ -21,6 +21,7 @@ set tmp_table_size=1024;
# Set debug flag so an error is returned when
# tmp table in query is converted from heap to myisam
+SET @saved_dbug = @@SESSION.debug_dbug;
set session debug_dbug="+d,raise_error";
--error ER_DUP_KEY
@@ -36,7 +37,7 @@ CREATE TABLE t1 (a INT(100) NOT NULL);
INSERT INTO t1 VALUES (1), (0), (2);
SET SESSION debug_dbug='+d,alter_table_only_index_change';
ALTER TABLE t1 ADD INDEX a(a);
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
@@ -51,7 +52,7 @@ SET SESSION debug_dbug="+d,bug42064_simulate_oom";
# May fail with either ER_OUT_OF_RESOURCES or EE_OUTOFMEMORY
--error ER_OUT_OF_RESOURCES, 5
INSERT INTO t1 VALUES("");
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1;
@@ -84,7 +85,7 @@ EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
-SET SESSION debug_dbug= DEFAULT;
+SET debug_dbug= @saved_dbug;
SET optimizer_switch=@save_optimizer_switch;
@@ -101,7 +102,7 @@ INSERT INTO t2 VALUES (1),(2);
SET SESSION debug_dbug="+d,bug11747970_raise_error";
--error ER_QUERY_INTERRUPTED
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
-SET SESSION debug_dbug = DEFAULT;
+SET debug_dbug= @saved_dbug;
DROP TABLE t1,t2;
@@ -156,4 +157,4 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
--error ER_OUT_OF_RESOURCES, 5
SELECT f1(1);
DROP FUNCTION f1;
-SET SESSION debug_dbug=DEFAULT;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/func_regexp_pcre_debug.result b/mysql-test/main/func_regexp_pcre_debug.result
index e44492fca72..40a379a077d 100644
--- a/mysql-test/main/func_regexp_pcre_debug.result
+++ b/mysql-test/main/func_regexp_pcre_debug.result
@@ -1,10 +1,9 @@
-SET debug_dbug='+d,pcre_exec_error_123';
+SET STATEMENT debug_dbug='+d,pcre_exec_error_123' for
SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
0
Warnings:
Warning 1139 Got error 'pcre_exec: Internal error (-123)' from regexp
-SET debug_dbug='';
SELECT 'a' RLIKE 'a';
'a' RLIKE 'a'
1
diff --git a/mysql-test/main/func_regexp_pcre_debug.test b/mysql-test/main/func_regexp_pcre_debug.test
index c2581fa4110..cbf5c4a17ee 100644
--- a/mysql-test/main/func_regexp_pcre_debug.test
+++ b/mysql-test/main/func_regexp_pcre_debug.test
@@ -1,6 +1,5 @@
--source include/have_debug.inc
-SET debug_dbug='+d,pcre_exec_error_123';
+SET STATEMENT debug_dbug='+d,pcre_exec_error_123' for
SELECT 'a' RLIKE 'a';
-SET debug_dbug='';
SELECT 'a' RLIKE 'a';
diff --git a/mysql-test/main/log_slow_debug.result b/mysql-test/main/log_slow_debug.result
index 71a76342aba..16d67d7fdc7 100644
--- a/mysql-test/main/log_slow_debug.result
+++ b/mysql-test/main/log_slow_debug.result
@@ -6,7 +6,7 @@ SET @@GLOBAL.log_output='TABLE';
FLUSH SLOW LOGS;
SET @@GLOBAL.slow_query_log=ON;
SET @@GLOBAL.log_slow_admin_statements=ON;
-SET @save_dbug = @@debug_dbug;
+SET @saved_dbug = @@debug_dbug;
SET SESSION debug_dbug="+d,simulate_slow_query";
CREATE PROCEDURE show_slow_log()
BEGIN
@@ -218,7 +218,7 @@ sql_text
#
# Clean up
#
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
TRUNCATE mysql.slow_log;
SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
diff --git a/mysql-test/main/log_slow_debug.test b/mysql-test/main/log_slow_debug.test
index 6b7cdd62f8a..aba4cbc8dcb 100644
--- a/mysql-test/main/log_slow_debug.test
+++ b/mysql-test/main/log_slow_debug.test
@@ -9,7 +9,7 @@ SET @@GLOBAL.log_output='TABLE';
FLUSH SLOW LOGS;
SET @@GLOBAL.slow_query_log=ON;
SET @@GLOBAL.log_slow_admin_statements=ON;
-SET @save_dbug = @@debug_dbug;
+SET @saved_dbug = @@debug_dbug;
SET SESSION debug_dbug="+d,simulate_slow_query";
DELIMITER $$;
@@ -87,7 +87,7 @@ CALL show_slow_log();
--echo # Clean up
--echo #
-SET SESSION debug_dbug=@save_dbug;
+SET SESSION debug_dbug=@saved_dbug;
TRUNCATE mysql.slow_log;
SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
diff --git a/mysql-test/main/mdev6830.result b/mysql-test/main/mdev6830.result
index d1cf8c98ac1..0048aa174bc 100644
--- a/mysql-test/main/mdev6830.result
+++ b/mysql-test/main/mdev6830.result
@@ -1,3 +1,4 @@
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (
@@ -46,3 +47,4 @@ SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5;
pk f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f1 f2
drop table t1,t2,t3,t4;
drop view v2,v3;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/mdev6830.test b/mysql-test/main/mdev6830.test
index 3898d5bbef6..ab5f19f7093 100644
--- a/mysql-test/main/mdev6830.test
+++ b/mysql-test/main/mdev6830.test
@@ -2,7 +2,7 @@
# MDEV-6830 Server crashes in best_access_path after a sequence of SELECTs invollving a temptable view
#
--source include/have_debug.inc
-
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
@@ -60,4 +60,4 @@ SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5;
drop table t1,t2,t3,t4;
drop view v2,v3;
-
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/merge-big.result b/mysql-test/main/merge-big.result
index 3b6e116986e..bd188d7a856 100644
--- a/mysql-test/main/merge-big.result
+++ b/mysql-test/main/merge-big.result
@@ -7,7 +7,7 @@ drop table if exists t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
LOCK TABLE t1 WRITE;
connect con1,localhost,root,,;
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
INSERT INTO t1 VALUES (1);
connection default;
diff --git a/mysql-test/main/merge-big.test b/mysql-test/main/merge-big.test
index 9bd2cab2c8a..5873d2eb233 100644
--- a/mysql-test/main/merge-big.test
+++ b/mysql-test/main/merge-big.test
@@ -42,7 +42,7 @@ LOCK TABLE t1 WRITE;
#SELECT NOW();
connect (con1,localhost,root,,);
let $con1_id= `SELECT CONNECTION_ID()`;
- SET @orig_debug=@@debug;
+ SET @orig_debug=@@global.debug_dbug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
send INSERT INTO t1 VALUES (1);
connection default;
diff --git a/mysql-test/main/merge_debug.result b/mysql-test/main/merge_debug.result
index 51905e52d24..29858810ff1 100644
--- a/mysql-test/main/merge_debug.result
+++ b/mysql-test/main/merge_debug.result
@@ -3,7 +3,7 @@ set global storage_engine=myisam;
set session storage_engine=myisam;
call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair it");
drop table if exists crashed,t2,t3,t4;
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
CREATE TABLE crashed (c1 INT);
CREATE TABLE t2 (c1 INT);
CREATE TABLE t3 (c1 INT);
diff --git a/mysql-test/main/merge_debug.test b/mysql-test/main/merge_debug.test
index 3c617cfc545..50017bc1331 100644
--- a/mysql-test/main/merge_debug.test
+++ b/mysql-test/main/merge_debug.test
@@ -14,7 +14,7 @@ call mtr.add_suppression("Index for table .*crashed' is corrupt; try to repair i
drop table if exists crashed,t2,t3,t4;
--enable_warnings
-SET @orig_debug=@@debug;
+SET @orig_debug=@@global.debug_dbug;
#
# Check that MariaDB handles reopen that fails without crashing
diff --git a/mysql-test/main/myisam_debug.result b/mysql-test/main/myisam_debug.result
index 6232e3eac0e..1428473c850 100644
--- a/mysql-test/main/myisam_debug.result
+++ b/mysql-test/main/myisam_debug.result
@@ -34,10 +34,10 @@ create table t1 (a int, index(a));
lock tables t1 write;
insert t1 values (1),(2),(1);
set @old_dbug=@@debug_dbug;
-set debug_dbug='+d,mi_lock_database_failure';
+SET debug_dbug='+d,mi_lock_database_failure';
unlock tables;
Warnings:
Error 126 Index for table './test/t1.MYI' is corrupt; try to repair it
Error 1030 Got error 22 "Invalid argument" from storage engine MyISAM
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
drop table t1;
diff --git a/mysql-test/main/myisam_debug.test b/mysql-test/main/myisam_debug.test
index 465ecd70895..2861c344b10 100644
--- a/mysql-test/main/myisam_debug.test
+++ b/mysql-test/main/myisam_debug.test
@@ -66,7 +66,7 @@ create table t1 (a int, index(a));
lock tables t1 write;
insert t1 values (1),(2),(1);
set @old_dbug=@@debug_dbug;
-set debug_dbug='+d,mi_lock_database_failure';
+SET debug_dbug='+d,mi_lock_database_failure';
unlock tables;
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
drop table t1;
diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result
index 6572b248911..38a8964bb61 100644
--- a/mysql-test/main/range_innodb.result
+++ b/mysql-test/main/range_innodb.result
@@ -70,6 +70,7 @@ key(a),key(b),key(c)
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
id select_type table type possible_keys key key_len ref rows Extra
@@ -77,5 +78,5 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from t1 where a=10 and b=10;
ERROR HY000: Table definition has changed, please retry transaction
DROP TABLE t0,t1;
-set @@global.debug_dbug="-d";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test
index a17ef3f1146..928ed74f784 100644
--- a/mysql-test/main/range_innodb.test
+++ b/mysql-test/main/range_innodb.test
@@ -80,10 +80,11 @@ create table t1 (
insert into t1
select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a
from t0 A, t0 B, t0 C, t0 D where D.a<5;
+SET @saved_dbug = @@GLOBAL.debug_dbug;
set @@global.debug_dbug="+d,ha_index_init_fail";
explain select * from t1 where a=10 and b=10;
--error ER_TABLE_DEF_CHANGED
select * from t1 where a=10 and b=10;
DROP TABLE t0,t1;
-set @@global.debug_dbug="-d";
+SET @@GLOBAL.debug_dbug = @saved_dbug;
set @@optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/main/range_interrupted-13751.result b/mysql-test/main/range_interrupted-13751.result
index f4f995721ad..68610cdda8e 100644
--- a/mysql-test/main/range_interrupted-13751.result
+++ b/mysql-test/main/range_interrupted-13751.result
@@ -7,10 +7,10 @@ INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
set @old_dbug=@@session.debug_dbug;
-set debug_dbug="+d,kill_join_init_read_record";
+SET debug_dbug="+d,kill_join_init_read_record";
SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.c = alias2.c OR alias1.i <= 1
;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
DROP TABLE t1;
diff --git a/mysql-test/main/range_interrupted-13751.test b/mysql-test/main/range_interrupted-13751.test
index 8b2c1834ee5..b0793edeb9d 100644
--- a/mysql-test/main/range_interrupted-13751.test
+++ b/mysql-test/main/range_interrupted-13751.test
@@ -14,14 +14,14 @@ INSERT INTO t1 (c) SELECT c FROM t1;
INSERT INTO t1 (c) SELECT c FROM t1;
set @old_dbug=@@session.debug_dbug;
-set debug_dbug="+d,kill_join_init_read_record";
+SET debug_dbug="+d,kill_join_init_read_record";
--error ER_QUERY_INTERRUPTED
SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.c = alias2.c OR alias1.i <= 1
;
-set debug_dbug=@old_dbug;
+SET debug_dbug=@old_dbug;
DROP TABLE t1;
diff --git a/mysql-test/main/select_debug.result b/mysql-test/main/select_debug.result
index 55882ad337a..dfe49aed215 100644
--- a/mysql-test/main/select_debug.result
+++ b/mysql-test/main/select_debug.result
@@ -6,6 +6,7 @@ insert into t1 values (2,2), (1,1);
create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
@@ -16,3 +17,4 @@ b
2
set session join_cache_level=default;
drop table t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/select_debug.test b/mysql-test/main/select_debug.test
index 49415400db3..922cec7ed7a 100644
--- a/mysql-test/main/select_debug.test
+++ b/mysql-test/main/select_debug.test
@@ -10,6 +10,7 @@ create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
+SET @saved_dbug = @@SESSION.debug_dbug;
set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
@@ -17,3 +18,4 @@ select t1.b from t1,t2 where t1.b=t2.a;
set session join_cache_level=default;
drop table t1,t2;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/show_explain.result b/mysql-test/main/show_explain.result
index 0819ae5ba37..e280ae7040e 100644
--- a/mysql-test/main/show_explain.result
+++ b/mysql-test/main/show_explain.result
@@ -23,7 +23,7 @@ show explain for $thr1;
ERROR HY000: Target is not running an EXPLAINable command
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select count(*) from t1 where a < 100000;
connection default;
show explain for $thr2;
@@ -58,10 +58,10 @@ connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan
set optimizer_switch= @show_expl_tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
connection default;
show explain for $thr2;
@@ -76,10 +76,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
connection default;
show explain for $thr2;
@@ -94,10 +94,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
show explain for $thr2;
@@ -109,10 +109,10 @@ Note 1003 select a, (select max(a) from t0 B) from t0 A where a<1
connection con1;
a (select max(a) from t0 B)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
show explain for $thr2;
@@ -125,10 +125,10 @@ connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -140,10 +140,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -155,10 +155,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -170,10 +170,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -185,10 +185,10 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
show explain for $thr2;
@@ -200,12 +200,12 @@ Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a
connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# Try to do SHOW EXPLAIN for a query that runs a SET command:
# I've found experimentally that select_id==2 here...
#
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @foo= (select max(a) from t0 where sin(a) >0);
connection default;
show explain for $thr2;
@@ -213,13 +213,13 @@ ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
connection con1;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for an UPDATE
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
show explain for $thr2;
@@ -236,13 +236,13 @@ Warnings:
Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3
connection con1;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Attempt SHOW EXPLAIN for a DELETE (UPD: now works)
#
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
show explain for $thr2;
@@ -259,13 +259,13 @@ Warnings:
Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3
connection con1;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Multiple SHOW EXPLAIN calls for one select
#
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
show explain for $thr2;
@@ -292,14 +292,14 @@ a SUBQ
1 0
2 0
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
#
explain select * from t0 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select * from t0 order by a;
connection default;
@@ -320,7 +320,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary"
#
@@ -329,7 +329,7 @@ explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
connection default;
@@ -350,7 +350,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
#
@@ -359,7 +359,7 @@ explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
connection default;
@@ -380,7 +380,7 @@ a
7
8
9
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
#
@@ -390,7 +390,7 @@ explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-set debug_dbug='+d,show_explain_in_find_all_keys';
+SET debug_dbug='+d,show_explain_in_find_all_keys';
SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
connection default;
# FIXED by "conservative assumptions about when QEP is available" fix:
@@ -406,7 +406,7 @@ a
1
2
4
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-239: Assertion `field_types == 0 ... ' failed in Protocol_text::store(double, uint32, String*) with
@@ -421,7 +421,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
connection default;
show explain for $thr2;
@@ -436,7 +436,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group by `test`.`t2`.`a`
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
#
# MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in
@@ -453,7 +453,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 6
2 DERIVED t3 system NULL NULL NULL NULL 1
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM v1, t2;
connection default;
show explain for $thr2;
@@ -461,14 +461,14 @@ ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
connection con1;
ERROR 70100: Query execution was interrupted
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
#
# MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select sleep(1);
connection default;
show explain for $thr2;
@@ -479,12 +479,12 @@ Note 1003 select sleep(1)
connection con1;
sleep(1)
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0 where 1>10;
connection default;
show explain for $thr2;
@@ -494,14 +494,14 @@ Warnings:
Note 1003 select * from t0 where 1>10
connection con1;
a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Same as above, but try another reason for JOIN to be degenerate (2)
#
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0,t3 where t3.a=112233;
connection default;
show explain for $thr2;
@@ -511,7 +511,7 @@ Warnings:
Note 1003 select * from t0,t3 where t3.a=112233
connection con1;
a a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t3;
#
# MDEV-270: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with
@@ -530,7 +530,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -552,7 +552,7 @@ pk a
6 7
7 7
9 7
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2;
#
# MDEV-273: SHOW EXPLAIN: server crashes in JOIN::print_explain on a query with impossible WHERE
@@ -584,7 +584,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join)
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
SELECT a1 FROM t2
@@ -605,7 +605,7 @@ WHERE a1 IN ( SELECT a1 FROM t2, t4 )
connection con1;
count(*)
1740
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2, t3, t4;
#
# MDEV-275: SHOW EXPLAIN: server crashes in JOIN::print_explain with IN subquery and aggregate function
@@ -615,7 +615,7 @@ INSERT INTO t2 VALUES
(1,5),(2,4),(3,6),(4,9),(5,2),(6,8),(7,4),(8,8),(9,0),(10,43),
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
connection default;
show explain for $thr2;
@@ -627,7 +627,7 @@ Warnings:
Note 1003 SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`)
connection con1;
pk a1
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
DROP TABLE t1;
#
@@ -636,7 +636,7 @@ DROP TABLE t1;
CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT 'test' FROM t1 WHERE a=1;
connection default;
show explain for $thr2;
@@ -648,7 +648,7 @@ connection con1;
test
test
test
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-299: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN changes back and forth during query execution
@@ -666,7 +666,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where
1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1)
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_test_if_quick_select';
+SET debug_dbug='+d,show_explain_probe_test_if_quick_select';
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
connection default;
show explain for $thr2;
@@ -696,7 +696,7 @@ Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND
connection con1;
count(*)
212
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while
@@ -705,7 +705,7 @@ drop table t1;
CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SHOW INDEX FROM t1;
connection default;
show explain for $thr2;
@@ -718,7 +718,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 a 1 a A NULL NULL NULL YES BTREE
t1 1 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-324: SHOW EXPLAIN: Plan produced by SHOW EXPLAIN for a query with TEMPTABLE view
@@ -731,7 +731,7 @@ EXPLAIN SELECT a + 1 FROM v1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
-set debug_dbug='+d,show_explain_probe_join_tab_preread';
+SET debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
SELECT a + 1 FROM v1;
connection default;
@@ -745,7 +745,7 @@ connection con1;
a + 1
2
3
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
#
@@ -761,7 +761,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
-set debug_dbug='+d,show_explain_probe_union_read';
+SET debug_dbug='+d,show_explain_probe_union_read';
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
connection default;
show explain for $thr2;
@@ -782,7 +782,7 @@ Warnings:
Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 )
connection con1;
a
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
#
# MDEV-327: SHOW EXPLAIN: Different select_type in plans produced by SHOW EXPLAIN
@@ -805,7 +805,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 SUBQUERY t1 ALL NULL NULL NULL NULL 20
3 SUBQUERY t2 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
connection default;
@@ -820,7 +820,7 @@ Note 1003 SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b )
connection con1;
a b
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1, t2;
#
# Test that SHOW EXPLAIN will print 'Distinct'.
@@ -842,7 +842,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select distinct t1.a from t1,t3 where t1.a=t3.a;
connection default;
show explain for $thr2;
@@ -855,7 +855,7 @@ connection con1;
a
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1,t3,t4;
#
# ---------- SHOW EXPLAIN and permissions -----------------
@@ -869,7 +869,7 @@ connection con1;
# First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
#
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection default;
connection con2;
@@ -886,14 +886,14 @@ a
0
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
#
# Check that user test2 can do SHOW EXPLAIN on its own queries
#
connect con3, localhost, test2,,;
connection con2;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection con1;
connection con3;
@@ -916,9 +916,9 @@ disconnect con2;
grant process on *.* to test2@localhost;
connect con2, localhost, test2,,;
connection con1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
connection default;
connection con2;
@@ -932,7 +932,7 @@ a
0
1
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
disconnect con2;
@@ -1009,7 +1009,7 @@ ORDER BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -1030,9 +1030,9 @@ a+SLEEP(0.01)
0
0
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
@@ -1053,7 +1053,7 @@ a+SLEEP(0.01)
0
0
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-298: SHOW EXPLAIN: Plan returned by SHOW EXPLAIN only contains
@@ -1067,7 +1067,7 @@ EXPLAIN SELECT a FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a FROM t1 GROUP BY a;
connection default;
show explain for $thr2;
@@ -1093,7 +1093,7 @@ a
14
15
16
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
#
# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
@@ -1107,7 +1107,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
connection default;
show explain for $thr2;
@@ -1119,7 +1119,7 @@ Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE
connection con1;
SUM(a + SLEEP(0.1))
7862
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1, t2;
#
# MDEV-412: SHOW EXPLAIN: Server crashes in JOIN::print_explain on a query with inner join and ORDER BY the same column twice
@@ -1157,7 +1157,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
connection default;
show explain for $thr2;
@@ -1169,7 +1169,7 @@ Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
connection con1;
field1 field2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-423: SHOW EXPLAIN: 'Using where' for a subquery is shown in EXPLAIN, but not in SHOW EXPLAIN output
@@ -1190,7 +1190,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 20
3 SUBQUERY t3 ALL NULL NULL NULL NULL 20 Using where
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
connection default;
@@ -1205,7 +1205,7 @@ WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10
connection con1;
max(a+b+c)
279
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
#
# MDEV-416: Server crashes in SQL_SELECT::cleanup on EXPLAIN with SUM ( DISTINCT ) in a non-correlated subquery (5.5-show-explain tree)
@@ -1231,7 +1231,7 @@ select hex('ãû');
hex('ãû')
E3FB
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where length('ãû') = a;
connection default;
set names utf8;
@@ -1244,7 +1244,7 @@ set names default;
connection con1;
a
2
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set names default;
#
# MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value
@@ -1270,7 +1270,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 2 Range checked for each record (index map: 0x1)
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
WHERE b <= ANY (
SELECT a FROM t1
@@ -1290,7 +1290,7 @@ WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 ))
connection con1;
SUM(b)
0
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2;
drop table t0;
#
@@ -1302,7 +1302,7 @@ 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';
+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;
diff --git a/mysql-test/main/show_explain.test b/mysql-test/main/show_explain.test
index 6615ff66737..2a87d24cf6d 100644
--- a/mysql-test/main/show_explain.test
+++ b/mysql-test/main/show_explain.test
@@ -15,7 +15,7 @@ SET @old_debug= @@session.debug;
# is that we use the following commands for synchronization:
#
# set @show_explain_probe_select_id=1;
-# set debug_dbug='d,show_explain_probe_join_exec_start';
+# SET debug_dbug='d,show_explain_probe_join_exec_start';
# send select count(*) from t1 where a < 100000;
#
# When ran with mysqltest_embedded, this translates into:
@@ -75,7 +75,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
#
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select count(*) from t1 where a < 100000;
connection default;
@@ -103,109 +103,109 @@ evalp show explain for $thr2;
connection con1;
reap;
set optimizer_switch= @show_expl_tmp;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # UNION, first branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # UNION, second branch
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # Uncorrelated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # Uncorrelated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a, (select max(a) from t0 B) from t0 A where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, select
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, select, while inside the subquery
set @show_explain_probe_select_id=2; # <---
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo # correlated subquery, explain, while inside the subquery
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
# TODO: explain in the parent subuqery when the un-correlated child has been
# run (and have done irreversible cleanups)
@@ -218,7 +218,7 @@ set debug_dbug=@old_debug;
--echo # I've found experimentally that select_id==2 here...
--echo #
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send set @foo= (select max(a) from t0 where sin(a) >0);
connection default;
--source include/wait_condition.inc
@@ -228,14 +228,14 @@ evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for an UPDATE
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
@@ -247,14 +247,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Attempt SHOW EXPLAIN for a DELETE (UPD: now works)
--echo #
create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
@@ -266,14 +266,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Multiple SHOW EXPLAIN calls for one select
--echo #
create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
--source include/wait_condition.inc
@@ -285,14 +285,14 @@ evalp show explain for $thr2;
connection con1;
reap;
drop table t2;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... ORDER BY with "Using filesort"
--echo #
explain select * from t0 order by a;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select * from t0 order by a;
connection default;
@@ -300,7 +300,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary"
@@ -309,7 +309,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -317,7 +317,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
@@ -326,7 +326,7 @@ connection default;
explain select distinct a from t0;
connection con1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
@@ -334,7 +334,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # MDEV-238: SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY
@@ -343,7 +343,7 @@ CREATE TABLE t2 ( a INT );
INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
explain SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
-set debug_dbug='+d,show_explain_in_find_all_keys';
+SET debug_dbug='+d,show_explain_in_find_all_keys';
send SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
connection default;
@@ -354,7 +354,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
@@ -370,7 +370,7 @@ INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
connection default;
@@ -378,7 +378,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
@@ -394,7 +394,7 @@ INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9);
explain SELECT * FROM v1, t2;
set @show_explain_probe_select_id=2;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send SELECT * FROM v1, t2;
connection default;
@@ -405,7 +405,7 @@ evalp kill query $thr2;
connection con1;
--error ER_QUERY_INTERRUPTED
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t2, t3;
@@ -413,21 +413,21 @@ DROP TABLE t2, t3;
--echo # MDEV-267: SHOW EXPLAIN: Server crashes in JOIN::print_explain on most of queries
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select sleep(1);
connection default;
--source include/wait_condition.inc
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0 where 1>10;
connection default;
--source include/wait_condition.inc
@@ -435,7 +435,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Same as above, but try another reason for JOIN to be degenerate (2)
@@ -443,7 +443,7 @@ set debug_dbug=@old_debug;
create table t3(a int primary key);
insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select * from t0,t3 where t3.a=112233;
connection default;
--source include/wait_condition.inc
@@ -451,7 +451,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t3;
--echo #
@@ -470,7 +470,7 @@ explain SELECT * FROM t2 WHERE a =
);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
@@ -480,7 +480,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2;
@@ -513,7 +513,7 @@ WHERE a1 < ALL (
);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send
SELECT count(*) FROM t2, t3
WHERE a1 < ALL (
@@ -526,7 +526,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t2, t3, t4;
--echo #
@@ -538,7 +538,7 @@ INSERT INTO t2 VALUES
(11,23),(12,3),(13,45),(14,16),(15,2),(16,33),(17,2),(18,5),(19,9),(20,2);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_end';
+SET debug_dbug='+d,show_explain_probe_join_exec_end';
send
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
connection default;
@@ -547,7 +547,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t2;
DROP TABLE t1;
@@ -559,7 +559,7 @@ CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send SELECT 'test' FROM t1 WHERE a=1;
connection default;
@@ -567,7 +567,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
@@ -591,7 +591,7 @@ set join_cache_level=0;
explain select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_test_if_quick_select';
+SET debug_dbug='+d,show_explain_probe_test_if_quick_select';
send
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
@@ -608,7 +608,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
--echo #
@@ -619,7 +619,7 @@ CREATE TABLE t1(a INT, b INT, c INT, KEY(a), KEY(b), KEY(c));
INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send SHOW INDEX FROM t1;
connection default;
@@ -627,7 +627,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
@@ -641,7 +641,7 @@ CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
EXPLAIN SELECT a + 1 FROM v1;
-set debug_dbug='+d,show_explain_probe_join_tab_preread';
+SET debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
send
@@ -651,7 +651,7 @@ connection default;
evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP VIEW v1;
DROP TABLE t1;
@@ -667,7 +667,7 @@ INSERT INTO t1 VALUES (4),(6);
EXPLAIN
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
-set debug_dbug='+d,show_explain_probe_union_read';
+SET debug_dbug='+d,show_explain_probe_union_read';
send
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
@@ -681,7 +681,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1;
--echo #
@@ -703,7 +703,7 @@ SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
@@ -714,7 +714,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1, t2;
--echo #
@@ -737,7 +737,7 @@ insert into t3 select * from t4;
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
select distinct t1.a from t1,t3 where t1.a=t3.a;
connection default;
@@ -746,7 +746,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1,t3,t4;
@@ -756,7 +756,7 @@ drop table t1,t3,t4;
create user test2@localhost;
grant ALL on test.* to test2@localhost;
-# Give the user SUPER privilege so it can set debug_dbug variable.
+# Give the user SUPER privilege so it can SET debug_dbug variable.
grant super on *.* to test2@localhost;
connect (con2, localhost, test2,,);
connection con1;
@@ -765,7 +765,7 @@ connection con1;
--echo # First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -781,7 +781,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
--echo #
--echo # Check that user test2 can do SHOW EXPLAIN on its own queries
@@ -791,7 +791,7 @@ connect (con3, localhost, test2,,);
connection con2;
let $thr_con2=`select connection_id()`;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -817,10 +817,10 @@ disconnect con2;
grant process on *.* to test2@localhost;
connect (con2, localhost, test2,,);
connection con1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where a < 3;
@@ -832,7 +832,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
@@ -912,7 +912,7 @@ WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -924,10 +924,10 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
--send
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
@@ -940,7 +940,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
@@ -956,7 +956,7 @@ INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12, t1 t13;
EXPLAIN SELECT a FROM t1 GROUP BY a;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT a FROM t1 GROUP BY a;
@@ -967,7 +967,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1;
@@ -983,7 +983,7 @@ INSERT INTO t2 VALUES (86,'English'),(87,'Russian');
explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
--send
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
@@ -994,7 +994,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
drop table t1, t2;
--echo #
@@ -1033,7 +1033,7 @@ explain
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
@@ -1045,7 +1045,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
@@ -1069,7 +1069,7 @@ SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
@@ -1082,7 +1082,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
--echo #
@@ -1109,7 +1109,7 @@ select charset('ãû');
select hex('ãû');
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
select * from t0 where length('ãû') = a;
@@ -1124,7 +1124,7 @@ connection con1;
# The constant should be two letters, the last looking like 'bl'
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set names default;
--echo #
@@ -1151,7 +1151,7 @@ WHERE b <= ANY (
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_join_exec_start';
+SET debug_dbug='+d,show_explain_probe_join_exec_start';
send
SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
@@ -1166,7 +1166,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
DROP TABLE t1,t2;
drop table t0;
@@ -1182,7 +1182,7 @@ 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';
+SET debug_dbug='+d,show_explain_probe_best_ext_lim_search';
send
explain
select * from t0
diff --git a/mysql-test/main/show_explain_non_select.result b/mysql-test/main/show_explain_non_select.result
index 6076a848e22..8d96056ca91 100644
--- a/mysql-test/main/show_explain_non_select.result
+++ b/mysql-test/main/show_explain_non_select.result
@@ -14,7 +14,7 @@ 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';
+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;
@@ -27,7 +27,7 @@ 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';
+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;
@@ -41,7 +41,7 @@ connection con2;
# Test SHOW EXPLAIN for single-table UPDATE
#
connection con2;
-set debug_dbug='+d,show_explain_probe_update_exec_start';
+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;
@@ -51,5 +51,5 @@ 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_dbug=@old_debug;
set debug_sync='RESET';
diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test
index 21b16739141..505e9296222 100644
--- a/mysql-test/main/show_explain_non_select.test
+++ b/mysql-test/main/show_explain_non_select.test
@@ -38,7 +38,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
--echo # Test SHOW EXPLAIN for single-table DELETE
--echo #
connection con2;
-set debug_dbug='+d,show_explain_probe_delete_exec_start';
+SET debug_dbug='+d,show_explain_probe_delete_exec_start';
send delete from t1 where a<10 and b+1>1000;
connection default;
@@ -51,7 +51,7 @@ reap;
--echo # Test SHOW EXPLAIN for multi-table DELETE
--echo #
set @show_explain_probe_select_id=1;
-set debug_dbug='+d,show_explain_probe_do_select';
+SET debug_dbug='+d,show_explain_probe_do_select';
send delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000;
connection default;
--source include/wait_condition.inc
@@ -63,7 +63,7 @@ reap;
--echo # Test SHOW EXPLAIN for single-table UPDATE
--echo #
connection con2;
-set debug_dbug='+d,show_explain_probe_update_exec_start';
+SET debug_dbug='+d,show_explain_probe_update_exec_start';
send update t1 set filler='filler-data-2' where a<10 and b+1>1000;
connection default;
@@ -74,5 +74,5 @@ reap;
drop table t0,t1;
-set debug_dbug=@old_debug;
+SET debug_dbug=@old_debug;
set debug_sync='RESET';
diff --git a/mysql-test/main/show_explain_ps.result b/mysql-test/main/show_explain_ps.result
index 69ee2cab31d..1c3be0d5953 100644
--- a/mysql-test/main/show_explain_ps.result
+++ b/mysql-test/main/show_explain_ps.result
@@ -17,7 +17,8 @@ connection con1;
connection default;
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='d,show_explain_probe_join_exec_start';
select count(*) from t0 where a < 100000;
connection default;
show explain for $thr2;
@@ -28,7 +29,7 @@ Note 1003 select count(*) from t0 where a < 100000
connection con1;
count(*)
10
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
select event_name
from
performance_schema.events_stages_history_long join
diff --git a/mysql-test/main/show_explain_ps.test b/mysql-test/main/show_explain_ps.test
index 13cd1538143..cbff0f50f96 100644
--- a/mysql-test/main/show_explain_ps.test
+++ b/mysql-test/main/show_explain_ps.test
@@ -38,7 +38,8 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
#
connection con1;
set @show_explain_probe_select_id=1;
-set debug_dbug='d,show_explain_probe_join_exec_start';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='d,show_explain_probe_join_exec_start';
send select count(*) from t0 where a < 100000;
connection default;
@@ -47,7 +48,7 @@ evalp show explain for $thr2;
connection con1;
reap;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
evalp select event_name
from
diff --git a/mysql-test/main/slowlog_enospace-10508.result b/mysql-test/main/slowlog_enospace-10508.result
index f39bfa2f00e..66fb19eed6a 100644
--- a/mysql-test/main/slowlog_enospace-10508.result
+++ b/mysql-test/main/slowlog_enospace-10508.result
@@ -3,7 +3,8 @@ create table t1 (a int, b int) engine=memory;
insert t1 select seq, seq+1 from seq_1_to_1000;
set global general_log=0;
set global log_queries_not_using_indexes=1;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
@@ -54,7 +55,7 @@ select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
select * from t1 where a>10;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
set global general_log=1;
set global log_queries_not_using_indexes=default;
drop table t1;
diff --git a/mysql-test/main/slowlog_enospace-10508.test b/mysql-test/main/slowlog_enospace-10508.test
index b2c26a5984d..74dca21f8ec 100644
--- a/mysql-test/main/slowlog_enospace-10508.test
+++ b/mysql-test/main/slowlog_enospace-10508.test
@@ -9,7 +9,8 @@ create table t1 (a int, b int) engine=memory;
insert t1 select seq, seq+1 from seq_1_to_1000;
set global general_log=0;
set global log_queries_not_using_indexes=1;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
--disable_result_log
--let $run= 50
while ($run)
@@ -18,7 +19,7 @@ while ($run)
dec $run;
}
--enable_result_log
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
set global general_log=1;
set global log_queries_not_using_indexes=default;
drop table t1;
diff --git a/mysql-test/main/stat_tables-enospc.result b/mysql-test/main/stat_tables-enospc.result
index 943cbca6bc5..9ac24a2af99 100644
--- a/mysql-test/main/stat_tables-enospc.result
+++ b/mysql-test/main/stat_tables-enospc.result
@@ -1,11 +1,12 @@
call mtr.add_suppression("No space left on device");
create table t1 (a varchar(255), b varchar(255), c varchar(255));
set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
set @@max_heap_table_size=128*1024;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze Error Error writing file 'tmp-file' (Errcode: 28 "No space left on device")
test.t1 analyze status Operation failed
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/stat_tables-enospc.test b/mysql-test/main/stat_tables-enospc.test
index 932b2bde302..fe8fe3590ae 100644
--- a/mysql-test/main/stat_tables-enospc.test
+++ b/mysql-test/main/stat_tables-enospc.test
@@ -16,9 +16,10 @@ while ($i) {
}
--enable_query_log
set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
-set debug_dbug='+d,simulate_file_write_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,simulate_file_write_error';
set @@max_heap_table_size=128*1024;
--replace_regex /'.*'/'tmp-file'/
analyze table t1;
-set debug_dbug='';
+SET debug_dbug= @saved_dbug;
drop table t1;
diff --git a/mysql-test/main/union_crash-714.result b/mysql-test/main/union_crash-714.result
index 4a51f88b76f..371be1e03d0 100644
--- a/mysql-test/main/union_crash-714.result
+++ b/mysql-test/main/union_crash-714.result
@@ -1,5 +1,7 @@
create table t1 (i tinyint);
-set debug_dbug='+d,bug11747970_raise_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,bug11747970_raise_error';
insert into t1 (i) select i from t1 union select i from t1;
ERROR 70100: Query execution was interrupted
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/union_crash-714.test b/mysql-test/main/union_crash-714.test
index 6c31a2202cb..90b849037f2 100644
--- a/mysql-test/main/union_crash-714.test
+++ b/mysql-test/main/union_crash-714.test
@@ -3,7 +3,9 @@
#
--source include/have_debug.inc
create table t1 (i tinyint);
-set debug_dbug='+d,bug11747970_raise_error';
+SET @saved_dbug = @@SESSION.debug_dbug;
+SET debug_dbug='+d,bug11747970_raise_error';
--error ER_QUERY_INTERRUPTED
insert into t1 (i) select i from t1 union select i from t1;
drop table t1;
+SET debug_dbug= @saved_dbug; \ No newline at end of file
diff --git a/mysql-test/main/warnings_debug.result b/mysql-test/main/warnings_debug.result
index 4cdce7a5feb..3a9d8225795 100644
--- a/mysql-test/main/warnings_debug.result
+++ b/mysql-test/main/warnings_debug.result
@@ -1,5 +1,6 @@
drop table if exists t1;
create table t1 (a int primary key) engine=innodb;
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,warn_during_ha_commit_trans";
INSERT INTO t1 VALUES (1);
Warnings:
@@ -8,3 +9,4 @@ SHOW WARNINGS;
Level Code Message
Warning 1196 Some non-transactional changed tables couldn't be rolled back
drop table t1;
+SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/main/warnings_debug.test b/mysql-test/main/warnings_debug.test
index 3055e3894e5..6605daf875d 100644
--- a/mysql-test/main/warnings_debug.test
+++ b/mysql-test/main/warnings_debug.test
@@ -9,6 +9,7 @@ create table t1 (a int primary key) engine=innodb;
# Test that warnings produced during autocommit (after calling
# set_ok_status()) are still reported to the client.
+SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,warn_during_ha_commit_trans";
INSERT INTO t1 VALUES (1);
# The warning will be shown automatically by mysqltest; there was a bug where
@@ -17,3 +18,4 @@ INSERT INTO t1 VALUES (1);
SHOW WARNINGS;
drop table t1;
+SET debug_dbug= @saved_dbug;