MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:msvensson Date:February 27 2006 9:30am
Subject:bk commit into 5.0 tree (msvensson:1.2080) BUG#16795
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.2080 06/02/27 10:29:55 msvensson@neptunus.(none) +3 -0
  Bug#16795 ndb_cache_multi2
   - Change && to ||
   - Check for return value != 0 in "ndb->init()"

  sql/ha_ndbcluster.cc
    1.234 06/02/27 10:29:51 msvensson@neptunus.(none) +1 -1
    && => ||, to call both the function "thd->store_global()" and "ndb->init()" 
    ndb_init returns 0 on sucess. Fail if not zero.

  mysql-test/t/ndb_cache_multi2.test
    1.5 06/02/27 10:29:51 msvensson@neptunus.(none) +8 -6
    Update test case
    - add printouts for what server the queries are from
    - Run the query from "while" once on server1 to cache it

  mysql-test/r/ndb_cache_multi2.result
    1.4 06/02/27 10:29:51 msvensson@neptunus.(none) +10 -14
    Update test result

# 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/bug16795/my50-bug16795

--- 1.233/sql/ha_ndbcluster.cc	2006-02-13 12:58:03 +01:00
+++ 1.234/sql/ha_ndbcluster.cc	2006-02-27 10:29:51 +01:00
@@ -6014,7 +6014,7 @@
   ndb_util_thread= pthread_self();
 
   thd->thread_stack= (char*)&thd; /* remember where our stack is */
-  if (thd->store_globals() && (ndb->init() != -1))
+  if (thd->store_globals() || (ndb->init() != 0))
   {
     thd->cleanup();
     delete thd;

--- 1.3/mysql-test/r/ndb_cache_multi2.result	2006-02-15 22:46:12 +01:00
+++ 1.4/mysql-test/r/ndb_cache_multi2.result	2006-02-27 10:29:51 +01:00
@@ -1,14 +1,17 @@
 drop table if exists t1, t2;
+== Connected to server1 ==
 set GLOBAL query_cache_type=on;
 set GLOBAL query_cache_size=1355776;
 set GLOBAL ndb_cache_check_time=1;
 reset query cache;
 flush status;
+== Connected to server2 ==
 set GLOBAL query_cache_type=on;
 set GLOBAL query_cache_size=1355776;
 set GLOBAL ndb_cache_check_time=1;
 reset query cache;
 flush status;
+== Connected to server1 ==
 create table t1 (a int) engine=ndbcluster;
 create table t2 (a int) engine=ndbcluster;
 insert into t1 value (2);
@@ -16,18 +19,22 @@
 select * from t1;
 a
 2
+select a != 3 from t1;
+a != 3
+1
 select * from t2;
 a
 3
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
-Qcache_queries_in_cache	2
+Qcache_queries_in_cache	3
 show status like "Qcache_inserts";
 Variable_name	Value
-Qcache_inserts	2
+Qcache_inserts	3
 show status like "Qcache_hits";
 Variable_name	Value
 Qcache_hits	0
+== Connected to server2 ==
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
 Qcache_queries_in_cache	0
@@ -50,24 +57,13 @@
 Variable_name	Value
 Qcache_hits	0
 update t1 set a=3 where a=2;
-show status like "Qcache_queries_in_cache";
-Variable_name	Value
-Qcache_queries_in_cache	2
-show status like "Qcache_inserts";
-Variable_name	Value
-Qcache_inserts	2
-show status like "Qcache_hits";
-Variable_name	Value
-Qcache_hits	0
+== Connected to server1 ==
 select * from t1;
 a
 3
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
 Qcache_queries_in_cache	3
-show status like "Qcache_inserts";
-Variable_name	Value
-Qcache_inserts	4
 drop table t1, t2;
 set GLOBAL query_cache_size=0;
 set GLOBAL ndb_cache_check_time=0;

--- 1.4/mysql-test/t/ndb_cache_multi2.test	2006-02-15 22:46:12 +01:00
+++ 1.5/mysql-test/t/ndb_cache_multi2.test	2006-02-27 10:29:51 +01:00
@@ -10,6 +10,7 @@
 
 # Turn on and reset query cache on server1
 connection server1;
+echo == Connected to server1 ==;
 set GLOBAL query_cache_type=on;
 set GLOBAL query_cache_size=1355776;
 set GLOBAL ndb_cache_check_time=1;
@@ -18,6 +19,7 @@
 
 # Turn on and reset query cache on server2
 connection server2;
+echo == Connected to server2 ==;
 set GLOBAL query_cache_type=on;
 set GLOBAL query_cache_size=1355776;
 set GLOBAL ndb_cache_check_time=1;
@@ -27,11 +29,14 @@
 # Create test tables in NDB and load them into cache
 # on server1
 connection server1;
+echo == Connected to server1 ==;
 create table t1 (a int) engine=ndbcluster;
 create table t2 (a int) engine=ndbcluster;
 insert into t1 value (2);
 insert into t2 value (3);
 select * from t1;
+# Run the check query once to load it into qc on server1
+select a != 3 from t1;
 select * from t2;
 show status like "Qcache_queries_in_cache";
 show status like "Qcache_inserts";
@@ -40,6 +45,7 @@
 
 # Connect server2, load table in to cache, then update the table
 connection server2;
+echo == Connected to server2 ==;
 show status like "Qcache_queries_in_cache";
 show status like "Qcache_inserts";
 show status like "Qcache_hits";
@@ -49,12 +55,10 @@
 show status like "Qcache_hits";
 update t1 set a=3 where a=2;
 
-# Connect to server1 and check that cache is invalidated 
+# Connect to server1 and check that cache is invalidated
 # and correct data is returned
 connection server1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
+echo == Connected to server1 ==;
 
 # Loop and wait for max 10 seconds until query cache thread
 # has invalidated the cache and the column a in t1 is equal to 3
@@ -75,8 +79,6 @@
 
 # There should now be three queries in the cache
 show status like "Qcache_queries_in_cache";
-# And inserts should be four
-show status like "Qcache_inserts";
 
 drop table t1, t2;
 
Thread
bk commit into 5.0 tree (msvensson:1.2080) BUG#16795msvensson27 Feb