From 9a3d3f47243efda3bb5175961949c882d3bc7429 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 8 Oct 2009 11:30:03 +0200 Subject: [PATCH] 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 --- client/mysqltest.cc | 1 + mysql-test/r/mysqltest.result | 1 + mysql-test/t/mysqltest.test | 3 +++ 3 files changed, 5 insertions(+) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index aaa08441e51..00131621bf5 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -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) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index f68413264e4..2e3a9489593 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -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 diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9859e73cfae..bcf33aa8c27 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -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;