1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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
This commit is contained in:
Bjorn Munch
2010-08-03 16:11:23 +02:00
parent f3d4e72cf1
commit 5e92df6e0e
4 changed files with 39 additions and 3 deletions

View File

@@ -1910,7 +1910,7 @@ select hex(s1) from t4;
drop table t1,t2,t3,t4;
}
if (test_foreign_keys)
if ($test_foreign_keys)
{
eval create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=$engine_type;
eval create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=$engine_type;
@@ -2405,7 +2405,7 @@ drop table t1, t2, t3, t5, t6, t8, t9;
}
# End transactional tests
if (test_foreign_keys)
if ($test_foreign_keys)
{
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
--error 1005

View File

@@ -393,6 +393,8 @@ true-inner again
true-outer
Counter is greater than 0, (counter=10)
Counter is not 0, (counter=0)
Counter is true, (counter=alpha)
Beta is true
1
Testing while with not
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply

View File

@@ -1105,6 +1105,25 @@ if (!$counter)
echo Counter is not 0, (counter=0);
}
# ----------------------------------------------------------------------------
# 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 }
# ----------------------------------------------------------------------------