MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:ramil Date:September 6 2005 10:00am
Subject:bk commit into 5.0 tree (ramil:1.1934) BUG#10303
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1934 05/09/06 15:00:35 ramil@stripped +5 -0
  fix (bug #10303: Misleading Last_query_cost value).

  sql/sql_cache.cc
    1.84 05/09/06 15:00:24 ramil@stripped +1 -0
    fix (bug #10303: Misleading Last_query_cost value).
    set the last_query_cost to 0.0 in case we use the query cache.

  mysql-test/t/status.test
    1.13 05/09/06 15:00:24 ramil@stripped +7 -0
    fix (bug #10303: Misleading Last_query_cost value).

  mysql-test/t/query_cache.test
    1.48 05/09/06 15:00:24 ramil@stripped +13 -0
    fix (bug #10303: Misleading Last_query_cost value).

  mysql-test/r/status.result
    1.8 05/09/06 15:00:24 ramil@stripped +6 -0
    fix (bug #10303: Misleading Last_query_cost value).

  mysql-test/r/query_cache.result
    1.64 05/09/06 15:00:24 ramil@stripped +16 -0
    fix (bug #10303: Misleading Last_query_cost value).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/5.0.b10303

--- 1.83/sql/sql_cache.cc	2005-08-19 19:17:42 +05:00
+++ 1.84/sql/sql_cache.cc	2005-09-06 15:00:24 +05:00
@@ -1178,6 +1178,7 @@
 #endif /*!EMBEDDED_LIBRARY*/
 
   thd->limit_found_rows = query->found_rows();
+  thd->status_var.last_query_cost= 0.0;
 
   BLOCK_UNLOCK_RD(query_block);
   DBUG_RETURN(1);				// Result sent to client

--- 1.63/mysql-test/r/query_cache.result	2005-08-11 22:42:02 +05:00
+++ 1.64/mysql-test/r/query_cache.result	2005-09-06 15:00:24 +05:00
@@ -1127,3 +1127,19 @@
 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;

--- 1.47/mysql-test/t/query_cache.test	2005-08-08 02:32:24 +05:00
+++ 1.48/mysql-test/t/query_cache.test	2005-09-06 15:00:24 +05:00
@@ -816,3 +816,16 @@
 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;

--- 1.7/mysql-test/r/status.result	2004-01-27 20:57:16 +04:00
+++ 1.8/mysql-test/r/status.result	2005-09-06 15:00:24 +05:00
@@ -17,3 +17,9 @@
 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

--- 1.12/mysql-test/t/status.test	2005-07-28 05:21:49 +05:00
+++ 1.13/mysql-test/t/status.test	2005-09-06 15:00:24 +05:00
@@ -37,3 +37,10 @@
 drop table t1;
 
 # End of 4.1 tests
+
+#
+# lost_query_cost
+#
+
+select 1;
+show status like 'last_query_cost';
Thread
bk commit into 5.0 tree (ramil:1.1934) BUG#10303ramil6 Sep