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.test57
1 files changed, 54 insertions, 3 deletions
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 25293ff29e7..031c51a0720 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -326,6 +326,15 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
--exec echo "disable_abort_on_error; error 1000; select 3 from t1; error 1000; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
+# Check some non-query statements that would fail
+# ----------------------------------------------------------------------------
+--exec illegal_command
+--cat_file does_not_exist
+--perl
+ exit(1);
+EOF
+
+# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
--error ER_PARSE_ERROR
@@ -863,7 +872,7 @@ while ($outer)
}
# Test source in an if in a while which is false on 1st iteration
-# Also test --error in same context
+# Also test --error and --disable_abort_on_error in same context
let $outer= 2; # Number of outer loops
let $ifval= 0; # false 1st time
while ($outer)
@@ -874,6 +883,10 @@ while ($outer)
--source $MYSQLTEST_VARDIR/tmp/sourced.inc
--error ER_NO_SUCH_TABLE
SELECT * from nowhere;
+ --disable_abort_on_error
+# Statement giving a different error, to make sure we don't mask it
+ SELECT * FROM nowhere else;
+ --enable_abort_on_error
}
dec $outer;
inc $ifval;
@@ -1093,6 +1106,36 @@ if (!$counter)
}
# ----------------------------------------------------------------------------
+# Test if with some non-numerics
+# ----------------------------------------------------------------------------
+
+let $counter=alpha;
+if ($counter)
+{
+ echo Counter is true, (counter=alpha);
+}
+let $counter= ;
+if ($counter)
+{
+ echo oops, space is true;
+}
+let $counter=-0;
+if ($counter)
+{
+ echo oops, -0 is true;
+}
+if (beta)
+{
+ echo Beta is true;
+}
+let $counter=gamma;
+while ($counter)
+{
+ echo while with string, only once;
+ let $counter=000;
+}
+
+# ----------------------------------------------------------------------------
# Test while, { and }
# ----------------------------------------------------------------------------
@@ -1437,7 +1480,6 @@ EOF
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# connect when "disable_abort_on_error" caused "connection not found"
---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--disable_abort_on_error
connect (con1,localhost,root,,);
connection default;
@@ -1724,7 +1766,16 @@ select 1;
--reap
EOF
--error 1
---exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in 2>&1
+# Must filter unpredictable extra warning from output
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in > $MYSQL_TMP_DIR/mysqltest.out 2>&1
+--perl
+ my $dir= $ENV{'MYSQL_TMP_DIR'};
+ open (FILE, "$dir/mysqltest.out");
+ while (<FILE>) {
+ print unless /Note: net_clear/; # This shows up on rare occations
+ }
+EOF
+remove_file $MYSQL_TMP_DIR/mysqltest.out;
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.in;
drop table t1;