summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-07-02 19:20:30 +0200
committerguilhem@mysql.com <>2004-07-02 19:20:30 +0200
commit83dbc6b0060d83f3102af54ccef97346f0fac629 (patch)
treeb6208d862b9cbbc1eb1e5524dda0c471e24a34cb /client
parent199d4f15d620b1a0417cc87741946019033ff333 (diff)
downloadmariadb-git-83dbc6b0060d83f3102af54ccef97346f0fac629.tar.gz
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.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 68b9dd505b2..2ec07692a4d 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -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))))