summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqltest.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/mysqltest.test')
-rw-r--r--mysql-test/t/mysqltest.test72
1 files changed, 70 insertions, 2 deletions
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index b4b4cf2f308..6c5efba8b5b 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1229,7 +1229,7 @@ select "a" as col1, "c" as col2;
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
---exec echo "replace_result a b; echo OK;" | $MYSQL_TEST 2>&1
+--exec echo "replace_result a b; echo OK; exit;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
--error 1
@@ -1293,7 +1293,7 @@ while ($i)
dec $i;
}
EOF
---exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
+--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Repeat connect/disconnect
@@ -1500,6 +1500,7 @@ echo Multi statement using expected error;
--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insertz "error query"||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
+--exec echo "exit;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
# These two should work since the error is expected
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1
@@ -1692,6 +1693,7 @@ EOF
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
--error 1
--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
+exit;
EOF
# Execute the above diffs, and send their output to /dev/null - only
@@ -2147,5 +2149,71 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
--replace_result c:\\a.txt z
SELECT 'c:\\a.txt' AS col;
+#
+# Bug #32307 mysqltest - does not detect illegal if syntax
+#
+
+let $test= 1;
+if ($test){
+ echo hej;
+}
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+if ($mysql_errno != 1436)
+{
+ echo ^ Should not be allowed!
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
+
+# ----------------------------------------------------------------------------
+# Test that -- is not allowed as comment, only as mysqltest builtin command
+# ----------------------------------------------------------------------------
+
+# valid
+select 1;
+--query select 1
+--query -- a comment for the server
+
+# Not valid, "select" is not a mysqltest command
+--error 1
+--exec echo "--select 1;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# BUG#35701: please allow test language variables in connection and sync_slave_with_master
+# Test that "connection $variable" works and that $CURRENT_CONNECTION has the right value.
+# ----------------------------------------------------------------------------
+
+connect (con1,localhost,root,,);
+--echo $CURRENT_CONNECTION
+
+connection default;
+--echo $CURRENT_CONNECTION
+
+connection con1;
+--echo $CURRENT_CONNECTION
+
+let $x= default;
+let $y= con1;
+
+connection $x;
+--echo $CURRENT_CONNECTION
+
+connection $y;
+--echo $CURRENT_CONNECTION
+
+# Disconnect the not selected connection
+disconnect $x;
+--echo $CURRENT_CONNECTION
+
+# Disconnect the selected connection
+disconnect $y;
+--echo $CURRENT_CONNECTION
+
+
--echo End of tests