#At file:///Users/clr/ndb/bzr-repo/mysql-5.1-telco-7.1-coord-jonas/ based on revid:jonas@stripped
4036 Craig L Russell 2011-02-18
Modified ndb_coord to be more fine-grained:
These test cases succeed:
ndb_coord_delete deletes one row and verifies that the row is not visible from both transactions.
ndb_coord_insert inserts one row and verifies that the row is visible from both transactions.
ndb_coord_update updates one row and verifies that the row's changes are visible from both transactions.
These test cases fail:
ndb_coord_delete_lookup deletes one row and verifies that the row is not visible via unique index lookup from both transactions.
ndb_coord_insert_lookup inserts one row and verifies that the row is visible via unique index lookup from both transactions.
ndb_coord_update_lookup updates one row and verifies that the row's changes are visible via unique index lookup from both transactions.
added:
mysql-test/suite/ndb/r/ndb_coord_delete.result
mysql-test/suite/ndb/r/ndb_coord_delete_lookup.result
mysql-test/suite/ndb/r/ndb_coord_insert.result
mysql-test/suite/ndb/r/ndb_coord_insert_lookup.result
mysql-test/suite/ndb/r/ndb_coord_update.result
mysql-test/suite/ndb/r/ndb_coord_update_lookup.result
mysql-test/suite/ndb/t/ndb_coord_delete.test
mysql-test/suite/ndb/t/ndb_coord_delete_lookup.test
mysql-test/suite/ndb/t/ndb_coord_insert.test
mysql-test/suite/ndb/t/ndb_coord_insert_lookup.test
mysql-test/suite/ndb/t/ndb_coord_update.test
mysql-test/suite/ndb/t/ndb_coord_update_lookup.test
=== added file 'mysql-test/suite/ndb/r/ndb_coord_delete.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_delete.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_delete.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,42 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+insert into t1 values(1,1,1,1,'a');
+begin;
+delete from t1 where pk = 1;
+select * from t1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+begin;
+select * from t1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/r/ndb_coord_delete_lookup.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_delete_lookup.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_delete_lookup.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,32 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+insert into t1 values(1,1,1,1,'a');
+begin;
+delete from t1 where pk = 1;
+select * from t1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+begin;
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/r/ndb_coord_insert.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_insert.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_insert.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,53 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+begin;
+insert into t1 values(1,1,1,1,'a');
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+begin;
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/r/ndb_coord_insert_lookup.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_insert_lookup.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_insert_lookup.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,38 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+begin;
+insert into t1 values(1,1,1,1,'a');
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+select * from t1 where attr4 = 'a';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+begin;
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 a
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/r/ndb_coord_update.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_update.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_update.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,54 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+insert into t1 values(1,1,1,1,'a');
+begin;
+update t1 set attr4 = 'c';
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr4 = 'c';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+begin;
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr4 = 'c';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/r/ndb_coord_update_lookup.result'
--- a/mysql-test/suite/ndb/r/ndb_coord_update_lookup.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_coord_update_lookup.result 2011-02-19 00:01:00 +0000
@@ -0,0 +1,39 @@
+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 INT,
+attr4 VARCHAR(10),
+unique(attr2),
+index(attr3)
+) ENGINE=ndbcluster;
+insert into t1 values(1,1,1,1,'a');
+begin;
+update t1 set attr4 = 'c';
+select * from t1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where pk >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr3 >= 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+select * from t1 where attr4 = 'c';
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+begin;
+select * from t1 where attr2 = 1;
+pk attr1 attr2 attr3 attr4
+1 1 1 1 c
+rollback;
+rollback;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_delete.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_delete.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_delete.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,59 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+insert into t1 values(1,1,1,1,'a');
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+delete from t1 where pk = 1;
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_delete_lookup.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_delete_lookup.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_delete_lookup.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,54 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+insert into t1 values(1,1,1,1,'a');
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+delete from t1 where pk = 1;
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+select * from t1 where attr2 = 1;
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_insert.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_insert.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_insert.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,57 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+insert into t1 values(1,1,1,1,'a');
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_insert_lookup.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_insert_lookup.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_insert_lookup.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,52 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+insert into t1 values(1,1,1,1,'a');
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'a';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+select * from t1 where attr2 = 1;
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_update.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_update.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_update.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,59 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+insert into t1 values(1,1,1,1,'a');
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+update t1 set attr4 = 'c';
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'c';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'c';
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
=== added file 'mysql-test/suite/ndb/t/ndb_coord_update_lookup.test'
--- a/mysql-test/suite/ndb/t/ndb_coord_update_lookup.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_coord_update_lookup.test 2011-02-19 00:01:00 +0000
@@ -0,0 +1,54 @@
+-- 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 INT,
+ attr4 VARCHAR(10),
+ unique(attr2),
+ index(attr3)
+) ENGINE=ndbcluster;
+
+insert into t1 values(1,1,1,1,'a');
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+begin;
+update t1 set attr4 = 'c';
+let $tid = `select @@ndb_transaction_id`;
+
+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 attr3 >= 1;
+select * from t1 where attr4 = 'c';
+
+connection con2;
+begin;
+
+disable_query_log;
+eval set ndb_join_transaction_id='$tid';
+enable_query_log;
+
+select * from t1 where attr2 = 1;
+
+connection con1;
+rollback;
+
+connection con2;
+rollback;
+
+connection con1;
+drop table t1;
Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20110219000100-q9vslalc29ro52vo.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1-coord branch (Craig.Russell:4036) | Craig L Russell | 19 Feb |