diff --git a/server/modules/routing/readwritesplit/test/rwsplit.sh b/server/modules/routing/readwritesplit/test/rwsplit.sh index c2e403b16..f55960009 100755 --- a/server/modules/routing/readwritesplit/test/rwsplit.sh +++ b/server/modules/routing/readwritesplit/test/rwsplit.sh @@ -230,6 +230,16 @@ if [ "$a" != "$TRETVAL" ]; then else echo "$TINPUT PASSED">>$TLOG ; fi + +TINPUT=test_temporary_table.sql +a=`$RUNCMD < ./$TINPUT` +TRETVAL=1 +if [ "$a" != "$TRETVAL" ]; then + echo "$TINPUT FAILED, return value $a when $TRETVAL was expected">>$TLOG; +else + echo "$TINPUT PASSED">>$TLOG ; +fi + echo "-----------------------------------" >> $TLOG echo "Session variables: Stress Test 1" >> $TLOG echo "-----------------------------------" >> $TLOG @@ -238,6 +248,10 @@ RUNCMD=mysql\ --host=$THOST\ -P$TPORT\ -u$TUSER\ -p$TPWD\ --unbuffered=true\ --d TINPUT=test_sescmd2.sql for ((i = 0;i<1000;i++)) do + if [[ $(( i % 50 )) -eq 0 ]] + then + printf "." + fi a=`$RUNCMD < $TINPUT 2>&1` if [[ "`echo "$a"|grep -i 'error'`" != "" ]] then @@ -255,15 +269,19 @@ fi echo "-----------------------------------" >> $TLOG echo "Session variables: Stress Test 2" >> $TLOG echo "-----------------------------------" >> $TLOG - +echo "" err="" TINPUT=test_sescmd3.sql for ((j = 0;j<1000;j++)) do - b=`$RUNCMD < $TINPUT 2>&1` - if [[ "`echo "$b"|grep -i 'null'`" != "" ]] + if [[ $(( j % 50 )) -eq 0 ]] then - err=`echo "$b" | grep -i null` + printf "." + fi + b=`$RUNCMD < $TINPUT 2>&1` + if [[ "`echo "$b"|grep -i 'null|error'`" != "" ]] + then + err=`echo "$b" | grep -i null|error` break fi done diff --git a/server/modules/routing/readwritesplit/test/test_temporary_table.sql b/server/modules/routing/readwritesplit/test/test_temporary_table.sql new file mode 100644 index 000000000..374510389 --- /dev/null +++ b/server/modules/routing/readwritesplit/test/test_temporary_table.sql @@ -0,0 +1,5 @@ +use test; +drop table if exists t1; +create temporary table t1 (id integer); +insert into t1 values(1); +select id from t1;