summaryrefslogtreecommitdiff
path: root/mysql-test/t/ndb_cache_multi.test
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-12-15 12:09:19 +0100
committerunknown <magnus@neptunus.(none)>2004-12-15 12:09:19 +0100
commitfcca1791e341ab23d9b571938002a4576972ed32 (patch)
tree847a9dba340aec21369659b680edd000158af5e4 /mysql-test/t/ndb_cache_multi.test
parentead004f91f38d5c90cb73e63969bc1a222c22325 (diff)
downloadmariadb-git-fcca1791e341ab23d9b571938002a4576972ed32.tar.gz
Added test case for multiple MySQL Servers connected to one cluster
Added test for cache in combination with multiple MySQL Servers mysql-test/include/have_ndb.inc: Added suport for connecting to two MySQL Server instances (I hope this will work on all platforms, since it does not use the socket parameter when openeing the connections, analog to how it looks like in replication tests)
Diffstat (limited to 'mysql-test/t/ndb_cache_multi.test')
-rw-r--r--mysql-test/t/ndb_cache_multi.test63
1 files changed, 63 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_cache_multi.test b/mysql-test/t/ndb_cache_multi.test
new file mode 100644
index 00000000000..ac4a80cee30
--- /dev/null
+++ b/mysql-test/t/ndb_cache_multi.test
@@ -0,0 +1,63 @@
+-- source include/have_query_cache.inc
+-- source include/have_ndb.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+
+# Turn on and reset query cache on server1
+connection server1;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+
+# Turn on and reset query cache on server2
+connection server2;
+set GLOBAL query_cache_type=on;
+set GLOBAL query_cache_size=1355776;
+reset query cache;
+flush status;
+
+
+
+# Create test tables in NDB and load them into cache
+# on server1
+connection 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;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+
+# Connect server2, load table in to cache, then update the table
+connection server2;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+update t1 set a=3 where a=2;
+
+# 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";
+select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
+show status like "Qcache_hits";
+
+drop table t1, t2;
+
+