MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:msvensson Date:September 29 2005 8:25am
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/29 10:25:44 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.
   - Add pkt_nr to query cache flags 

  sql/sql_cache.cc
    1.85 05/09/29 10:25:40 msvensson@neptunus.(none) +6 -2
    Set pkt_nr in flags before retrieving/storing a query in the cache

  sql/mysql_priv.h
    1.352 05/09/29 10:25:39 msvensson@neptunus.(none) +1 -0
    Add pkt_nr to query cache flags

  mysql-test/t/query_cache.test
    1.48 05/09/29 10:25:39 msvensson@neptunus.(none) +42 -0
    Improve test to call queries from both a regular statment and a statement inside a stored procedure.

  mysql-test/r/query_cache.result
    1.64 05/09/29 10:25:39 msvensson@neptunus.(none) +157 -13
    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.351/sql/mysql_priv.h	2005-09-15 01:57:51 +02:00
+++ 1.352/sql/mysql_priv.h	2005-09-29 10:25:39 +02:00
@@ -537,6 +537,7 @@
   unsigned int client_long_flag:1;
   unsigned int client_protocol_41:1;
   unsigned int more_results_exists:1;
+  unsigned int pkt_nr;
   uint character_set_client_num;
   uint character_set_results_num;
   uint collation_connection_num;

--- 1.84/sql/sql_cache.cc	2005-09-06 19:51:08 +02:00
+++ 1.85/sql/sql_cache.cc	2005-09-29 10:25:40 +02:00
@@ -801,6 +801,7 @@
                                    CLIENT_PROTOCOL_41);
     flags.more_results_exists= test(thd->server_status &
                                     SERVER_MORE_RESULTS_EXISTS);
+    flags.pkt_nr= net->pkt_nr;
     flags.character_set_client_num=
       thd->variables.character_set_client->number;
     flags.character_set_results_num=
@@ -814,12 +815,13 @@
     flags.sql_mode= thd->variables.sql_mode;
     flags.max_sort_length= thd->variables.max_sort_length;
     flags.group_concat_max_len= thd->variables.group_concat_max_len;
-    DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, \
+    DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \
 CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
 sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
                           (int)flags.client_long_flag,
                           (int)flags.client_protocol_41,
                           (int)flags.more_results_exists,
+                          flags.pkt_nr,
                           flags.character_set_client_num,
                           flags.character_set_results_num,
                           flags.collation_connection_num,
@@ -1019,6 +1021,7 @@
                                  CLIENT_PROTOCOL_41);
   flags.more_results_exists= test(thd->server_status &
                                   SERVER_MORE_RESULTS_EXISTS);
+  flags.pkt_nr= thd->net.pkt_nr;
   flags.character_set_client_num= thd->variables.character_set_client->number;
   flags.character_set_results_num=
     (thd->variables.character_set_results ?
@@ -1030,12 +1033,13 @@
   flags.sql_mode= thd->variables.sql_mode;
   flags.max_sort_length= thd->variables.max_sort_length;
   flags.group_concat_max_len= thd->variables.group_concat_max_len;
-  DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, \
+  DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, pkt_nr: %d, \
 CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \
 sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
                           (int)flags.client_long_flag,
                           (int)flags.client_protocol_41,
                           (int)flags.more_results_exists,
+                          flags.pkt_nr,
                           flags.character_set_client_num,
                           flags.character_set_results_num,
                           flags.collation_connection_num,

--- 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-29 10:25:39 +02: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,28 +1124,150 @@
 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;

--- 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-29 10:25:39 +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;
@@ -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.0 tree (msvensson:1.1965) BUG#13231msvensson29 Sep