Skip to content

Commit 06a7352

Browse files
LinuxJedigrooverdan
authored andcommitted
MDEV-34605 Fix tmp_table_count-7586
This test ran `show status like '%Created_tmp%'`. This captures `Created_tmp_files` as well as the intended `Created_tmp_tables`. In 11.5, the former got moved to `FLUSH GLOBAL`, so when testing, the result can now be random. This fix makes the test just use `Created_tmp_tables`.
1 parent 2f4b0ba commit 06a7352

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

mysql-test/main/tmp_table_count-7586.result

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ a
77
1
88
2
99
3
10-
show status like '%Created_tmp%';
10+
show status like '%Created_tmp_tables%';
1111
Variable_name Value
12-
Created_tmp_disk_tables 0
13-
Created_tmp_files 0
1412
Created_tmp_tables 0
1513
explain select * from v2;
1614
id select_type table type possible_keys key key_len ref rows Extra
@@ -20,10 +18,8 @@ a
2018
1
2119
2
2220
3
23-
show status like '%Created_tmp%';
21+
show status like '%Created_tmp_tables%';
2422
Variable_name Value
25-
Created_tmp_disk_tables 0
26-
Created_tmp_files 0
2723
Created_tmp_tables 0
2824
explain select * from (select * from t2) T1;
2925
id select_type table type possible_keys key key_len ref rows Extra
@@ -46,10 +42,8 @@ CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING
4642
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
4743
sum(created_tmp_tables)
4844
2
49-
show status like '%Created_tmp%';
45+
show status like '%Created_tmp_tables%';
5046
Variable_name Value
51-
Created_tmp_disk_tables 0
52-
Created_tmp_files 0
5347
Created_tmp_tables 2
5448
drop table t3;
5549
set @@optimizer_switch="firstmatch=off";
@@ -65,10 +59,8 @@ CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a);
6559
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
6660
sum(created_tmp_tables)
6761
1
68-
show status like '%Created_tmp%';
62+
show status like '%Created_tmp_tables%';
6963
Variable_name Value
70-
Created_tmp_disk_tables 0
71-
Created_tmp_files 0
7264
Created_tmp_tables 1
7365
set @@optimizer_switch=default;
7466
drop table t1,t2,t3;
@@ -78,8 +70,6 @@ flush status;
7870
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
7971
sum(created_tmp_tables)
8072
0
81-
show status like '%Created_tmp%';
73+
show status like '%Created_tmp_tables%';
8274
Variable_name Value
83-
Created_tmp_disk_tables 0
84-
Created_tmp_files 0
8575
Created_tmp_tables 0

mysql-test/main/tmp_table_count-7586.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ create view v2 as select a from t2;
1414
flush status;
1515
select * from v2;
1616
--disable_ps_protocol
17-
show status like '%Created_tmp%';
17+
show status like '%Created_tmp_tables%';
1818
--enable_ps_protocol
1919

2020
explain select * from v2;
2121

2222
select * from (select * from t2) T1;
2323
--disable_ps_protocol
24-
show status like '%Created_tmp%';
24+
show status like '%Created_tmp_tables%';
2525
--enable_ps_protocol
2626

2727
explain select * from (select * from t2) T1;
@@ -44,7 +44,7 @@ flush status;
4444
CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1);
4545
--echo # Performance schema should be the same as "Created_tmp_tables" variable below
4646
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
47-
show status like '%Created_tmp%';
47+
show status like '%Created_tmp_tables%';
4848
drop table t3;
4949

5050
set @@optimizer_switch="firstmatch=off";
@@ -54,7 +54,7 @@ flush status;
5454
CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a);
5555
--echo # Performance schema should be the same as "Created_tmp_tables" variable below
5656
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
57-
show status like '%Created_tmp%';
57+
show status like '%Created_tmp_tables%';
5858
set @@optimizer_switch=default;
5959

6060
drop table t1,t2,t3;
@@ -63,4 +63,4 @@ truncate table performance_schema.events_statements_history_long;
6363
flush status;
6464
--echo # Performance schema should be the same as "Created_tmp_tables" variable below
6565
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
66-
show status like '%Created_tmp%';
66+
show status like '%Created_tmp_tables%';

0 commit comments

Comments
 (0)