Bug #47218 mysqltest ignores "error" command inside if inside loop

This was affected by same problem as append_file etc.
Added Q_ERROR to special handling, and added small test
This commit is contained in:
Bjorn Munch 2009-10-08 11:30:03 +02:00
parent 57d40c6ba4
commit 9a3d3f4724
3 changed files with 5 additions and 0 deletions

View file

@ -7708,6 +7708,7 @@ int main(int argc, char **argv)
if (!ok_to_do)
{
if (command->type == Q_SOURCE ||
command->type == Q_ERROR ||
command->type == Q_WRITE_FILE ||
command->type == Q_APPEND_FILE ||
command->type == Q_PERL)

View file

@ -317,6 +317,7 @@ here is the sourced script
outer=2 ifval=0
outer=1 ifval=1
here is the sourced script
ERROR 42S02: Table 'test.nowhere' doesn't exist
In loop
here is the sourced script

View file

@ -854,6 +854,7 @@ while ($outer)
}
# Test source in an if in a while which is false on 1st iteration
# Also test --error in same context
let $outer= 2; # Number of outer loops
let $ifval= 0; # false 1st time
while ($outer)
@ -862,6 +863,8 @@ while ($outer)
if ($ifval) {
--source $MYSQLTEST_VARDIR/tmp/sourced.inc
--error ER_NO_SUCH_TABLE
SELECT * from nowhere;
}
dec $outer;
inc $ifval;