diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2010-09-27 14:36:16 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2010-09-27 14:36:16 +0200 |
commit | 500cb492959eef3771f03fd516eb1a21fb2924da (patch) | |
tree | aea44ce20ddbd6f9f132bc1bd46416cc2bbb2123 /mysql-test/t/mysqltest.test | |
parent | d244b2872d4ab589868b5448abee0c9fd7b090bd (diff) | |
download | mariadb-git-500cb492959eef3771f03fd516eb1a21fb2924da.tar.gz |
Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints
Adds boolean flag is_int and a separete function to check for int value
Added tests to mysqltest.test
Diffstat (limited to 'mysql-test/t/mysqltest.test')
-rw-r--r-- | mysql-test/t/mysqltest.test | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c054b163c0c..45dbb4a5c8d 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1006,16 +1006,13 @@ EOF # ---------------------------------------------------------------------------- # Test inc # ---------------------------------------------------------------------------- -inc $i; -echo $i; +let $i= 0; inc $i; echo $i; let $i=100; inc $i; echo $i; - -let $i=hej; -echo $i; +let $i= -100; inc $i; echo $i; @@ -1024,7 +1021,13 @@ echo $i; --error 1 --exec echo "inc i;" | $MYSQL_TEST 2>&1 --error 1 +--exec echo "inc \$i;" | $MYSQL_TEST 2>&1 +--error 1 --exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "let \$i=text; inc \$i; echo \$i;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "let \$i=10cc; inc \$i; echo \$i;" | $MYSQL_TEST 2>&1 inc $i; inc $i; inc $i; --echo $i echo $i; @@ -1034,25 +1037,25 @@ echo $i; # Test dec # ---------------------------------------------------------------------------- -dec $d; -echo $d; +let $d= 0; dec $d; echo $d; let $d=100; dec $d; echo $d; -let $d=hej; -echo $d; -dec $d; -echo $d; - --error 1 --exec echo "dec;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "dec i;" | $MYSQL_TEST 2>&1 --error 1 +--exec echo "dec \$i;" | $MYSQL_TEST 2>&1 +--error 1 --exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "let \$i=text; dec \$i; echo \$i;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "let \$i=10cc; dec \$i; echo \$i;" | $MYSQL_TEST 2>&1 # ---------------------------------------------------------------------------- |