diff --git a/server/modules/routing/readwritesplit/test/rwsplit.sh b/server/modules/routing/readwritesplit/test/rwsplit.sh index fc0c56822..d64fcf495 100755 --- a/server/modules/routing/readwritesplit/test/rwsplit.sh +++ b/server/modules/routing/readwritesplit/test/rwsplit.sh @@ -169,6 +169,8 @@ else echo "$TINPUT PASSED">>$TLOG ; fi +# Disable autocommit in the first session and then test in new session that +# it is again enabled. TINPUT=test_autocommit_disabled2.sql TRETVAL=1 a=`$RUNCMD < ./$TINPUT` @@ -178,3 +180,14 @@ else echo "$TINPUT PASSED">>$TLOG ; fi +TINPUT=set_autocommit_disabled.sql +`$RUNCMD < ./$TINPUT` +TINPUT=test_after_autocommit_disabled.sql +TRETVAL=$TMASTER_ID +a=`$RUNCMD < ./$TINPUT` +if [ "$a" == "$TRETVAL" ]; then + echo "$TINPUT FAILED, return value $a when it was not accetable">>$TLOG; +else + echo "$TINPUT PASSED">>$TLOG ; +fi + diff --git a/server/modules/routing/readwritesplit/test/set_autocommit_disabled.sql b/server/modules/routing/readwritesplit/test/set_autocommit_disabled.sql new file mode 100644 index 000000000..a182b4922 --- /dev/null +++ b/server/modules/routing/readwritesplit/test/set_autocommit_disabled.sql @@ -0,0 +1,7 @@ +use test; +drop table if exists t1; +create table t1 (id integer); +set autocommit=0; -- open transaction +begin; +insert into t1 values(1); -- write to master +commit; diff --git a/server/modules/routing/readwritesplit/test/test_after_autocommit_disabled.sql b/server/modules/routing/readwritesplit/test/test_after_autocommit_disabled.sql new file mode 100644 index 000000000..f10c5eb8c --- /dev/null +++ b/server/modules/routing/readwritesplit/test/test_after_autocommit_disabled.sql @@ -0,0 +1,2 @@ +use test; +select @@server_id; \ No newline at end of file