List:Internals« Previous MessageNext Message »
From:kent Date:November 1 2005 10:02pm
Subject:bk commit into 5.1 tree (kent:1.1948)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kent. When kent 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.1948 05/11/01 22:01:54 kent@stripped +4 -0
  Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-tmp
  into mysql.com:/Users/kent/mysql/bk/mysql-5.1

  sql/sql_select.cc
    1.370 05/11/01 22:01:45 kent@stripped +0 -0
    Auto merged

  sql/sql_cache.cc
    1.86 05/11/01 22:01:42 kent@stripped +0 -0
    Auto merged

  mysql-test/t/query_cache.test
    1.49 05/11/01 22:01:41 kent@stripped +0 -0
    Auto merged

  mysql-test/r/query_cache.result
    1.65 05/11/01 22:01:40 kent@stripped +0 -0
    Auto merged

# 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:	kent
# Host:	c-7d4072d5.010-2112-6f72651.cust.bredbandsbolaget.se
# Root:	/Users/kent/mysql/bk/mysql-5.1/RESYNC

--- 1.85/sql/sql_cache.cc	2005-10-06 10:26:01 +02:00
+++ 1.86/sql/sql_cache.cc	2005-11-01 22:01:42 +01:00
@@ -1204,6 +1204,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.369/sql/sql_select.cc	2005-10-28 10:48:02 +02:00
+++ 1.370/sql/sql_select.cc	2005-11-01 22:01:45 +01:00
@@ -537,6 +537,9 @@
     DBUG_RETURN(0);
   optimized= 1;
 
+  if (thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
+    thd->status_var.last_query_cost= 0.0;
+
   row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR :
 	      unit->select_limit_cnt);
   /* select_limit is used to decide if we are likely to scan the whole table */

--- 1.64/mysql-test/r/query_cache.result	2005-09-06 12:00:24 +02:00
+++ 1.65/mysql-test/r/query_cache.result	2005-11-01 22:01:40 +01:00
@@ -1057,42 +1057,64 @@
 create procedure f1 () begin
 select sql_cache * from t1;
 select sql_cache * from t1;
+select sql_cache * from t1;
+end;//
+create procedure f2 () begin
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1;
+end;//
+create procedure f3 () begin
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+end;//
+create procedure f4 () begin
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1 where s1=1;
 end;//
 call f1();
 s1
+s1
+s1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	1
+Qcache_queries_in_cache	3
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	1
+Qcache_inserts	3
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	1
+Qcache_hits	0
 call f1();
 s1
+s1
+s1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	1
+Qcache_queries_in_cache	3
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	1
+Qcache_inserts	3
 show status like "Qcache_hits";
 Variable_name	Value
 Qcache_hits	3
 call f1();
 s1
+s1
+s1
 select sql_cache * from t1;
 s1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	2
+Qcache_queries_in_cache	4
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	2
+Qcache_inserts	4
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	5
+Qcache_hits	6
 insert into t1 values (1);
 select sql_cache * from t1;
 s1
@@ -1102,29 +1124,151 @@
 Qcache_queries_in_cache	1
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	3
+Qcache_inserts	5
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	5
+Qcache_hits	6
 call f1();
 s1
 1
+s1
+1
+s1
+1
 call f1();
 s1
 1
+s1
+1
+s1
+1
 select sql_cache * from t1;
 s1
 1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	2
+Qcache_queries_in_cache	4
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	4
+Qcache_inserts	8
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	9
+Qcache_hits	10
+flush query cache;
+reset query cache;
+flush status;
+select sql_cache * from t1;
+s1
+1
+select sql_cache * from t1 where s1=1;
+s1
+1
+call f1();
+s1
+1
+s1
+1
+s1
+1
+call f2();
+s1
+1
+s1
+1
+call f3();
+s1
+1
+s1
+1
+call f4();
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+call f4();
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+call f3();
+s1
+1
+s1
+1
+call f2();
+s1
+1
+s1
+1
+select sql_cache * from t1 where s1=1;
+s1
+1
+insert into t1 values (2);
+call f1();
+s1
+1
+2
+s1
+1
+2
+s1
+1
+2
+select sql_cache * from t1 where s1=1;
+s1
+1
+select sql_cache * from t1;
+s1
+1
+2
+call f1();
+s1
+1
+2
+s1
+1
+2
+s1
+1
+2
+call f3();
+s1
+1
+2
+s1
+1
+call f3();
+s1
+1
+2
+s1
+1
+call f1();
+s1
+1
+2
+s1
+1
+2
+s1
+1
+2
 drop procedure f1;
+drop procedure f2;
+drop procedure f3;
+drop procedure f4;
 drop table t1;
 set GLOBAL query_cache_size=0;
 SET GLOBAL query_cache_size=102400;

--- 1.48/mysql-test/t/query_cache.test	2005-09-06 12:00:24 +02:00
+++ 1.49/mysql-test/t/query_cache.test	2005-11-01 22:01:41 +01:00
@@ -776,6 +776,7 @@
 
 #
 # query in QC from normal execution and SP (BUG#6897)
+# improved to also test BUG#3583 and BUG#12990
 #
 flush query cache;
 reset query cache;
@@ -785,6 +786,22 @@
 create procedure f1 () begin
 select sql_cache * from t1;
 select sql_cache * from t1;
+select sql_cache * from t1;
+end;//
+create procedure f2 () begin
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1;
+end;//
+create procedure f3 () begin
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+end;//
+create procedure f4 () begin
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1 where s1=1;
 end;//
 delimiter ;//
 call f1();
@@ -811,7 +828,32 @@
 show status like "Qcache_queries_in_cache";
 show status like "Qcache_inserts";
 show status like "Qcache_hits";
+flush query cache;
+reset query cache;
+flush status;
+select sql_cache * from t1;
+select sql_cache * from t1 where s1=1;
+call f1();
+call f2();
+call f3();
+call f4();
+call f4();
+call f3();
+call f2();
+select sql_cache * from t1 where s1=1;
+insert into t1 values (2);
+call f1();
+select sql_cache * from t1 where s1=1;
+select sql_cache * from t1;
+call f1();
+call f3();
+call f3();
+call f1();
+
 drop procedure f1;
+drop procedure f2;
+drop procedure f3;
+drop procedure f4;
 drop table t1;
 set GLOBAL query_cache_size=0;
 
Thread
bk commit into 5.1 tree (kent:1.1948)kent1 Nov