summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorserg@serg.mylan <>2003-12-06 23:21:09 +0100
committerserg@serg.mylan <>2003-12-06 23:21:09 +0100
commit6d0703ab5b4005f2cc5bcd6eb9a2a6235208ef07 (patch)
tree63c4006a74c5d36672d3bce9c6978cb1a831bdbe /mysql-test
parent95bdc62bea1185501fa31f9a199d9184a79076d3 (diff)
downloadmariadb-git-6d0703ab5b4005f2cc5bcd6eb9a2a6235208ef07.tar.gz
QUERY_NO_GOOD_INDEX_USED and QUERY_NO_INDEX_USED moved from thd->lex.select_lex->options to thd->server_status
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/union.result38
-rw-r--r--mysql-test/t/union-master.opt1
-rw-r--r--mysql-test/t/union.test26
3 files changed, 62 insertions, 3 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 241b9847c02..642c07904b5 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -823,3 +823,41 @@ count(*)
13
drop table t1,t2;
set local tmp_table_size=default;
+create table t1 (a int, index (a), b int);
+insert t1 values (1,1),(2,2),(3,3),(4,4),(5,5);
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+FLUSH STATUS;
+show status like 'Slow_queries';
+Variable_name Value
+Slow_queries 0
+select count(*) from t1 where a=7;
+count(*)
+26
+show status like 'Slow_queries';
+Variable_name Value
+Slow_queries 0
+select count(*) from t1 where b=13;
+count(*)
+10
+show status like 'Slow_queries';
+Variable_name Value
+Slow_queries 1
+select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
+count(*)
+0
+26
+show status like 'Slow_queries';
+Variable_name Value
+Slow_queries 2
+select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
+count(*)
+26
+10
+show status like 'Slow_queries';
+Variable_name Value
+Slow_queries 3
+drop table t1;
diff --git a/mysql-test/t/union-master.opt b/mysql-test/t/union-master.opt
new file mode 100644
index 00000000000..3eb98fc3d6b
--- /dev/null
+++ b/mysql-test/t/union-master.opt
@@ -0,0 +1 @@
+--log-slow-queries --log-long-format --log-queries-not-using-indexes
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index e302378e117..a5cb1ce6b6e 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -419,9 +419,6 @@ drop table t1;
#
# conversion memory->disk table
#
-#
-# conversion memory->disk table
-#
create table t1 (s char(200));
insert into t1 values (repeat("1",200));
create table t2 select * from t1;
@@ -436,3 +433,26 @@ select count(*) from t1;
select count(*) from t2;
drop table t1,t2;
set local tmp_table_size=default;
+
+#
+# slow logging
+#
+create table t1 (a int, index (a), b int);
+insert t1 values (1,1),(2,2),(3,3),(4,4),(5,5);
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+insert t1 select a+1, a+b from t1;
+FLUSH STATUS;
+show status like 'Slow_queries';
+select count(*) from t1 where a=7;
+show status like 'Slow_queries';
+select count(*) from t1 where b=13;
+show status like 'Slow_queries';
+select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
+show status like 'Slow_queries';
+select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
+show status like 'Slow_queries';
+drop table t1;
+