diff options
author | Bjorn Munch <bjorn.bunch@oracle.com> | 2010-08-03 16:11:23 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.bunch@oracle.com> | 2010-08-03 16:11:23 +0200 |
commit | 5e92df6e0ee01cdea7865d3f0b6d02f840bf0402 (patch) | |
tree | b38f90257b306555af6e691d0592cf4474bcc9f9 /mysql-test/t/mysqltest.test | |
parent | f3d4e72cf1e98499ba189aa95747e999079d94e8 (diff) | |
download | mariadb-git-5e92df6e0ee01cdea7865d3f0b6d02f840bf0402.tar.gz |
Bug #55582 mtr root detection (and if-expression execution) broken
if() treated any non-numeric string as false
Fixed to treat those as true instead
Added some test cases
Fixed missing $ in variable name in include/mix2.inc
Diffstat (limited to 'mysql-test/t/mysqltest.test')
-rw-r--r-- | mysql-test/t/mysqltest.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 09916f4f8cf..b88cde8c8f0 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1106,6 +1106,25 @@ 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; +} +if (beta) +{ + echo Beta is true; +} + +# ---------------------------------------------------------------------------- # Test while, { and } # ---------------------------------------------------------------------------- |