diff options
author | unknown <ramil@mysql.com> | 2005-09-06 15:00:35 +0500 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2005-09-06 15:00:35 +0500 |
commit | 811c6d216ec224a019dad5a99e356720677b6d22 (patch) | |
tree | c261ab180af03ac30a8a8be7a06d6b62b1ee74ee /mysql-test | |
parent | 2a0f9f33ed8a6f509807cbfd18de5f6f88f4ed6d (diff) | |
download | mariadb-git-811c6d216ec224a019dad5a99e356720677b6d22.tar.gz |
fix (bug #10303: Misleading Last_query_cost value).
sql/sql_cache.cc:
fix (bug #10303: Misleading Last_query_cost value).
set the last_query_cost to 0.0 in case we use the query cache.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/query_cache.result | 16 | ||||
-rw-r--r-- | mysql-test/r/status.result | 6 | ||||
-rw-r--r-- | mysql-test/t/query_cache.test | 13 | ||||
-rw-r--r-- | mysql-test/t/status.test | 7 |
4 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0efd5ac1566..06f1d2d0e7c 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1127,3 +1127,19 @@ Qcache_hits 9 drop procedure f1; drop table t1; set GLOBAL query_cache_size=0; +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +a +4 +5 +select * from t1 where a > 3; +a +4 +5 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index e9616232fa1..5461e4dd563 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -17,3 +17,9 @@ Variable_name Value Table_locks_immediate 3 Table_locks_waited 1 drop table t1; +select 1; +1 +1 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 822c27fe40d..db759fcbac3 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -816,3 +816,16 @@ drop table t1; set GLOBAL query_cache_size=0; # End of 4.1 tests + +# +# Bug #10303: problem with last_query_cost +# + +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +select * from t1 where a > 3; +show status like 'last_query_cost'; +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 7fea51c9327..929a0cb5877 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -37,3 +37,10 @@ show status like 'Table_lock%'; drop table t1; # End of 4.1 tests + +# +# lost_query_cost +# + +select 1; +show status like 'last_query_cost'; |