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

Fixing a bug in mysqltest.c:

if a command has a comment at the end of line, like:
error 2002 ; # this is error 2002
then the parsing of comment should not make mysqltest
forget about the value of expected error.
Reason it forgot it (so the next query caused the test to fail)
is that internally the above line is 2 queries.



client/mysqltest.c:
  if a command has a comment at the end of line, like:
  error 2002 ; # this is error 2002
  then the parsing of comment should not make mysqltest
  forget about the value of expected error.
This commit is contained in:
unknown
2004-07-02 19:20:30 +02:00
parent 6f45a5f18a
commit b30cd30a66

View File

@@ -1817,13 +1817,6 @@ int read_query(struct st_query** q_ptr)
q->record_file[0] = 0;
q->require_file=0;
q->first_word_len = 0;
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
sizeof(global_expected_errno));
q->expected_errors=global_expected_errors;
q->abort_on_error = global_expected_errno[0] == 0;
bzero((gptr) global_expected_errno,sizeof(global_expected_errno));
global_expected_errors=0;
q->type = Q_UNKNOWN;
q->query_buf=q->query=0;
if (read_line(read_query_buf, sizeof(read_query_buf)))
@@ -1832,8 +1825,16 @@ int read_query(struct st_query** q_ptr)
if (*p == '#')
{
q->type = Q_COMMENT;
/* This goto is to avoid losing the "expected error" info. */
goto end;
}
else if (p[0] == '-' && p[1] == '-')
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
sizeof(global_expected_errno));
q->expected_errors=global_expected_errors;
q->abort_on_error = global_expected_errno[0] == 0;
bzero((gptr) global_expected_errno,sizeof(global_expected_errno));
global_expected_errors=0;
if (p[0] == '-' && p[1] == '-')
{
q->type = Q_COMMENT_WITH_COMMAND;
p+=2; /* To calculate first word */
@@ -1868,6 +1869,8 @@ int read_query(struct st_query** q_ptr)
*p1 = 0;
}
}
end:
while (*p && my_isspace(charset_info,*p))
p++;
if (!(q->query_buf=q->query=my_strdup(p,MYF(MY_WME))))