19
18
show status like 'last_query_cost';
20
create temporary table t1 (a int) engine=myisam;
19
create table t1 (a int) engine=myisam;
21
20
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
22
21
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
23
22
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
24
23
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
25
24
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
26
25
select * from t1 where a=6;
28
26
show status like 'last_query_cost';
29
27
# Ensure value dosn't change by second status call
31
28
show status like 'last_query_cost';
34
30
show status like 'last_query_cost';
74
71
--enable_result_log
77
SELECT ASSERT(VARIABLE_VALUE = 1) FROM data_dictionary.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
74
SHOW STATUS LIKE 'max_used_connections';
75
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
79
77
# Save original setting.
80
78
connect (con1,localhost,root,,);
88
86
# Check that max_used_connections still reflects maximum value.
89
SELECT ASSERT(VARIABLE_VALUE >= 3) FROM data_dictionary.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
87
SHOW STATUS LIKE 'max_used_connections';
88
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
92
91
# Bug #30377: EXPLAIN loses last_query_cost when used with UNION
95
CREATE TABLE t1 ( a INT );
94
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
96
95
INSERT INTO t1 VALUES (1), (2);
98
97
SELECT a FROM t1 LIMIT 1;
99
98
SHOW SESSION STATUS LIKE 'Last_query_cost';
102
100
EXPLAIN SELECT a FROM t1;
103
101
SHOW SESSION STATUS LIKE 'Last_query_cost';
105
103
SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
106
104
SHOW SESSION STATUS LIKE 'Last_query_cost';
109
106
EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
110
107
SHOW SESSION STATUS LIKE 'Last_query_cost';
115
112
SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
116
113
SHOW SESSION STATUS LIKE 'Last_query_cost';
118
SELECT * FROM t1 a CROSS JOIN t1 b LIMIT 1;
115
SELECT * FROM t1 a, t1 b LIMIT 1;
119
116
SHOW SESSION STATUS LIKE 'Last_query_cost';