summaryrefslogtreecommitdiff
path: root/client/mysqltest.c
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r--client/mysqltest.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index bd467e821ab..3b13084081e 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -2385,8 +2385,6 @@ int read_query(struct st_query** q_ptr)
sizeof(global_expected_errno));
q->expected_errors= global_expected_errors;
q->abort_on_error= (global_expected_errors == 0 && abort_on_error);
- bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
- global_expected_errors=0;
if (p[0] == '-' && p[1] == '-')
{
q->type= Q_COMMENT_WITH_COMMAND;
@@ -4002,6 +4000,16 @@ int main(int argc, char **argv)
else
check_eol_junk(q->last_argument);
+ if (q->type != Q_ERROR)
+ {
+ /*
+ As soon as any non "error" command has been executed,
+ the array with expected errors should be cleared
+ */
+ global_expected_errors= 0;
+ bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
+ }
+
parser.current_line += current_line_inc;
}