summaryrefslogtreecommitdiff
path: root/mysql-test/t/ndb_single_user.test
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-03-23 21:50:57 +0100
committerunknown <tomas@whalegate.ndb.mysql.com>2007-03-23 21:50:57 +0100
commit4d3291e62c2b0e6b52f8bfa5782fc96458441277 (patch)
tree04d05ee60b5e3616bdd241f57aec499218fde184 /mysql-test/t/ndb_single_user.test
parent65401f91974a5677d735c26f669332e466f62826 (diff)
parent27fc5de41aa6005d61c520e050ec0b8795b366eb (diff)
downloadmariadb-git-4d3291e62c2b0e6b52f8bfa5782fc96458441277.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user storage/ndb/include/util/OutputStream.hpp: Auto merged
Diffstat (limited to 'mysql-test/t/ndb_single_user.test')
-rw-r--r--mysql-test/t/ndb_single_user.test53
1 files changed, 37 insertions, 16 deletions
diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test
index c655124f79f..b191e573996 100644
--- a/mysql-test/t/ndb_single_user.test
+++ b/mysql-test/t/ndb_single_user.test
@@ -51,34 +51,55 @@ insert into t1 select * from t2;
--connection server2
--error 1051
drop table t1;
---error 1146
-#--error 1296
+--error 1296
create index new_index on t1 (c);
---error 1146
-#--error 1296
+--error 1296
insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0),(6,6,0),(7,7,0),(8,8,0),(9,9,0),(10,10,0);
---error 1146
-#--error 1296
+--error 1296
select * from t1 where a = 1;
---error 1146
-#--error 1296
+--error 1296
select * from t1 where b = 4;
---error 1146
-#--error 1296
+--error 1296
update t1 set b=102 where a = 2;
---error 1146
-#--error 1296
+--error 1296
update t1 set b=103 where b = 3;
---error 1146
-#--error 1296
+--error 1296
update t1 set b=b+100;
---error 1146
-#--error 1296
+--error 1296
update t1 set b=b+100 where a > 7;
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
+#
+# we should be able to run transaction while in single user mode
+#
+--connection server1
+BEGIN;
+update t1 set b=b+100 where a=1;
+
+--connection server2
+BEGIN;
+update t1 set b=b+100 where a=2;
+
+# enter single user mode
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" --single-user >> $NDB_TOOLS_OUTPUT
+
+--connection server1
+update t1 set b=b+100 where a=3;
+COMMIT;
+
+# while on other mysqld it should be aborted
+--connection server2
+--error 1296
+update t1 set b=b+100 where a=4;
+--error 1296
+COMMIT;
+
+--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "exit single user mode" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
+
# cleanup
--connection server1
drop table t1;