diff options
-rw-r--r-- | client/mysqltest.cc | 7 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 1 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index d45f9acd87a..8ba1271e1fa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7571,9 +7571,6 @@ void get_command_type(struct st_command* command) sizeof(saved_expected_errors)); DBUG_PRINT("info", ("There are %d expected errors", command->expected_errors.count)); - command->abort_on_error= (command->expected_errors.count == 0 && - abort_on_error); - DBUG_VOID_RETURN; } @@ -7918,6 +7915,10 @@ int main(int argc, char **argv) command->type= Q_COMMENT; } + /* (Re-)set abort_on_error for this command */ + command->abort_on_error= (command->expected_errors.count == 0 && + abort_on_error); + /* delimiter needs to be executed so we can continue to parse */ my_bool ok_to_do= cur_block->ok || command->type == Q_DELIMITER; /* diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 67c08b0ae97..38112c032b5 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -325,6 +325,7 @@ outer=2 ifval=0 outer=1 ifval=1 here is the sourced script ERROR 42S02: Table 'test.nowhere' doesn't exist +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'else' at line 1 In loop here is the sourced script diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 25293ff29e7..b2d7c59a8a0 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -863,7 +863,7 @@ while ($outer) } # Test source in an if in a while which is false on 1st iteration -# Also test --error in same context +# Also test --error and --disable_abort_on_error in same context let $outer= 2; # Number of outer loops let $ifval= 0; # false 1st time while ($outer) @@ -874,6 +874,10 @@ while ($outer) --source $MYSQLTEST_VARDIR/tmp/sourced.inc --error ER_NO_SUCH_TABLE SELECT * from nowhere; + --disable_abort_on_error +# Statement giving a different error, to make sure we don't mask it + SELECT * FROM nowhere else; + --enable_abort_on_error } dec $outer; inc $ifval; |