List:Internals« Previous MessageNext Message »
From:msvensson Date:September 27 2005 2:00pm
Subject:bk commit into 5.0 tree (msvensson:1.1965) BUG#13231
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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.1965 05/09/27 15:59:51 msvensson@neptunus.(none) +4 -0
  Bug #13231  	mysqltest: fails to dectect when mysql_next_result fails
   - Packets out of order when reading cached data stored by a normal select from a ps or vice versa.
   - Disabble stored procedure from caching queries in the query cache.

  sql/sp_head.h
    1.71 05/09/27 15:59:45 msvensson@neptunus.(none) +1 -0
    Disable query caching in sp_instr_stmt constructor

  mysql-test/t/query_cache.test
    1.48 05/09/27 15:59:45 msvensson@neptunus.(none) +39 -0
    Improve test to call queries from both a regular statment and a statement inside a stored procedure.
    When qc + sp is enabled, this test should still pass.

  mysql-test/r/sp.result
    1.156 05/09/27 15:59:44 msvensson@neptunus.(none) +1 -1
    Since qc is disable in stored procedure, the Qcache_hits is zero

  mysql-test/r/query_cache.result
    1.64 05/09/27 15:59:44 msvensson@neptunus.(none) +131 -14
    Update test results
    Add the resultsets that wasn't there before.

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug13231/my50-bug13231

--- 1.63/mysql-test/r/query_cache.result	2005-08-11 19:42:02 +02:00
+++ 1.64/mysql-test/r/query_cache.result	2005-09-27 15:59:44 +02:00
@@ -1058,41 +1058,58 @@
 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;
+end;//
 call f1();
 s1
+s1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	1
+Qcache_queries_in_cache	0
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	1
+Qcache_inserts	0
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	1
+Qcache_hits	0
 call f1();
 s1
+s1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	1
+Qcache_queries_in_cache	0
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	1
+Qcache_inserts	0
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	3
+Qcache_hits	0
 call f1();
 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	1
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	2
+Qcache_inserts	1
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	5
+Qcache_hits	0
 insert into t1 values (1);
 select sql_cache * from t1;
 s1
@@ -1102,28 +1119,128 @@
 Qcache_queries_in_cache	1
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	3
+Qcache_inserts	2
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	5
+Qcache_hits	0
 call f1();
 s1
 1
+s1
+1
 call f1();
 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	1
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	4
+Qcache_inserts	2
 show status like "Qcache_hits";
 Variable_name	Value
-Qcache_hits	9
+Qcache_hits	1
+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
+call f2();
+s1
+1
+s1
+1
+call f3();
+s1
+1
+s1
+1
+call f4();
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+call f4();
+s1
+1
+s1
+1
+s1
+1
+s1
+1
+call f3();
+s1
+1
+s1
+1
+call f2();
+s1
+1
+s1
+1
+insert into t1 values (2);
+call f1();
+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
+call f3();
+s1
+1
+2
+s1
+1
+call f3();
+s1
+1
+2
+s1
+1
+call f1();
+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;

--- 1.47/mysql-test/t/query_cache.test	2005-08-07 23:32:24 +02:00
+++ 1.48/mysql-test/t/query_cache.test	2005-09-27 15:59:45 +02: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;
@@ -786,6 +787,20 @@
 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;
+end;//
 delimiter ;//
 call f1();
 show status like "Qcache_queries_in_cache";
@@ -811,7 +826,31 @@
 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();
+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;
 

--- 1.155/mysql-test/r/sp.result	2005-09-14 12:54:42 +02:00
+++ 1.156/mysql-test/r/sp.result	2005-09-27 15:59:44 +02:00
@@ -2263,7 +2263,7 @@
 2
 show status like 'Qcache_hits'|
 Variable_name	Value
-Qcache_hits	2
+Qcache_hits	0
 set global query_cache_size = @x|
 flush status|
 flush query cache|

--- 1.70/sql/sp_head.h	2005-09-14 10:53:55 +02:00
+++ 1.71/sql/sp_head.h	2005-09-27 15:59:45 +02:00
@@ -495,6 +495,7 @@
   {
     m_query.str= 0;
     m_query.length= 0;
+    m_lex_keeper.disable_query_cache();
   }
 
   virtual ~sp_instr_stmt()
Thread
bk commit into 5.0 tree (msvensson:1.1965) BUG#13231msvensson27 Sep