List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 16 2011 10:47am
Subject:bzr commit into mysql-5.1-telco-7.1-coord branch (jonas:4034)
View as plain text  
#At file:///home/jonas/src/71-coord/ based on revid:jonas@stripped

 4034 jonas oreland	2011-02-16
      ndb coord - add rudemenatry mtr test for coord trans functionality

    added:
      mysql-test/suite/ndb/r/ndb_coord.result
      mysql-test/suite/ndb/t/ndb_coord.test
=== added file 'mysql-test/suite/ndb/r/ndb_coord.result'
--- a/mysql-test/suite/ndb/r/ndb_coord.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord.result	2011-02-16 10:47:30 +0000
@@ -0,0 +1,96 @@
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+CREATE TABLE t1 (
+pk INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL,
+attr2 INT,
+attr3 VARCHAR(10),
+unique(attr2)
+) ENGINE=ndbcluster;
+begin;
+insert into t1 values(1,1,1,'a');
+begin;
+select * from t1;
+pk	attr1	attr2	attr3
+1	1	1	a
+select * from t1 where pk = 1;
+pk	attr1	attr2	attr3
+1	1	1	a
+select * from t1 where attr2 = 1;
+pk	attr1	attr2	attr3
+1	1	1	a
+select * from t1 where pk >= 1;
+pk	attr1	attr2	attr3
+1	1	1	a
+delete from t1;
+select * from t1;
+pk	attr1	attr2	attr3
+select * from t1 where pk = 1;
+pk	attr1	attr2	attr3
+select * from t1 where attr2 = 1;
+pk	attr1	attr2	attr3
+select * from t1 where pk >= 1;
+pk	attr1	attr2	attr3
+insert into t1 values(2,2,2,'b');
+select * from t1;
+pk	attr1	attr2	attr3
+2	2	2	b
+select * from t1 where pk = 1;
+pk	attr1	attr2	attr3
+select * from t1 where attr2 = 1;
+pk	attr1	attr2	attr3
+select * from t1 where pk >= 1;
+pk	attr1	attr2	attr3
+2	2	2	b
+select * from t1 where pk = 2;
+pk	attr1	attr2	attr3
+2	2	2	b
+select * from t1 where attr2 = 2;
+pk	attr1	attr2	attr3
+2	2	2	b
+select * from t1 where pk >= 2;
+pk	attr1	attr2	attr3
+2	2	2	b
+update t1 set attr3 = 'c';
+select * from t1;
+pk	attr1	attr2	attr3
+2	2	2	c
+select * from t1 where pk = 1;
+pk	attr1	attr2	attr3
+select * from t1 where attr2 = 1;
+pk	attr1	attr2	attr3
+select * from t1 where pk >= 1;
+pk	attr1	attr2	attr3
+2	2	2	c
+select * from t1 where pk = 2;
+pk	attr1	attr2	attr3
+2	2	2	c
+select * from t1 where attr2 = 2;
+pk	attr1	attr2	attr3
+2	2	2	c
+select * from t1 where pk >= 2;
+pk	attr1	attr2	attr3
+2	2	2	c
+update t1 set attr2 = 1;
+select * from t1;
+pk	attr1	attr2	attr3
+2	2	1	c
+select * from t1 where pk = 1;
+pk	attr1	attr2	attr3
+select * from t1 where attr2 = 1;
+pk	attr1	attr2	attr3
+2	2	1	c
+select * from t1 where pk >= 1;
+pk	attr1	attr2	attr3
+2	2	1	c
+select * from t1 where pk = 2;
+pk	attr1	attr2	attr3
+2	2	1	c
+select * from t1 where attr2 = 2;
+pk	attr1	attr2	attr3
+select * from t1 where pk >= 2;
+pk	attr1	attr2	attr3
+2	2	1	c
+rollback;
+rollback;
+drop table t1;

=== added file 'mysql-test/suite/ndb/t/ndb_coord.test'
--- a/mysql-test/suite/ndb/t/ndb_coord.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord.test	2011-02-16 10:47:30 +0000
@@ -0,0 +1,94 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+drop database if exists mysqltest;
+--enable_warnings
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+  pk INT NOT NULL PRIMARY KEY,
+  attr1 INT NOT NULL,
+  attr2 INT,
+  attr3 VARCHAR(10),
+  unique(attr2)
+) ENGINE=ndbcluster;
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+insert into t1 values(1,1,1,'a');
+let $tid = `select @@ndb_transaction_id`;
+
+connection con2;
+begin;
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+connection con1;
+select * from t1;
+select * from t1 where pk = 1;
+select * from t1 where attr2 = 1;
+select * from t1 where pk >= 1;
+
+connection con1;
+delete from t1;
+
+connection con2;
+select * from t1;
+select * from t1 where pk = 1;
+select * from t1 where attr2 = 1;
+select * from t1 where pk >= 1;
+
+connection con1;
+insert into t1 values(2,2,2,'b');
+
+connection con2;
+select * from t1;
+select * from t1 where pk = 1;
+select * from t1 where attr2 = 1;
+select * from t1 where pk >= 1;
+
+select * from t1 where pk = 2;
+select * from t1 where attr2 = 2;
+select * from t1 where pk >= 2;
+
+connection con1;
+update t1 set attr3 = 'c';
+
+connection con2;
+select * from t1;
+select * from t1 where pk = 1;
+select * from t1 where attr2 = 1;
+select * from t1 where pk >= 1;
+
+select * from t1 where pk = 2;
+select * from t1 where attr2 = 2;
+select * from t1 where pk >= 2;
+
+connection con1;
+update t1 set attr2 = 1;
+
+connection con2;
+select * from t1;
+select * from t1 where pk = 1;
+select * from t1 where attr2 = 1;
+select * from t1 where pk >= 1;
+
+select * from t1 where pk = 2;
+select * from t1 where attr2 = 2;
+select * from t1 where pk >= 2;
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110216104730-t0aan66nto68s2xc.bundle
Thread
bzr commit into mysql-5.1-telco-7.1-coord branch (jonas:4034) jonas oreland16 Feb