summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-12-09 12:15:25 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2010-12-09 12:15:25 +0100
commit06790ea7becae1eab1e2dad9d2d7390bf4ed6df3 (patch)
tree56e71e26021e45962f98baa693c6672736a6f68a /mysql-test
parent81d29b1d82a48dfbe373c440b06c2f570691983f (diff)
downloadmariadb-git-06790ea7becae1eab1e2dad9d2d7390bf4ed6df3.tar.gz
Bug #58695 mysqltest coredumps on "if($x == ){"
Add check that there is a RHS of the expression Added to mysqltest.test
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqltest.result2
-rw-r--r--mysql-test/t/mysqltest.test5
2 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 6892164c225..3073dda1154 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -434,6 +434,8 @@ anything goes
mysqltest: At line 2: Only == and != are supported for string values
mysqltest: At line 2: Found junk '~= 6' after $variable in condition
mysqltest: At line 2: Expression in if/while must beging with $, ` or a number
+mysqltest: At line 1: Missing right operand in comparison
+mysqltest: At line 1: Missing right operand in comparison
counter is 2
counter is 3
counter is 4
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 186b0e0fbfa..f7d433c70e8 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1354,6 +1354,11 @@ EOF
--exec $MYSQL_TEST < $MYSQL_TMP_DIR/mysqltest.sql 2>&1
remove_file $MYSQL_TMP_DIR/mysqltest.sql;
+--error 1
+--exec echo "if (\$var ==) {" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "if (\$var > ) {" | $MYSQL_TEST 2>&1
+
# ----------------------------------------------------------------------------
# Test while with compare conditions
# ----------------------------------------------------------------------------