diff options
author | unknown <guilhem@mysql.com> | 2004-07-02 19:20:30 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-07-02 19:20:30 +0200 |
commit | b30cd30a662762f7823749bd56d2dc7c67b330ce (patch) | |
tree | b6208d862b9cbbc1eb1e5524dda0c471e24a34cb /client | |
parent | 6f45a5f18a0e7a8891e2106c85801f262c8ff069 (diff) | |
download | mariadb-git-b30cd30a662762f7823749bd56d2dc7c67b330ce.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.
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 19 |
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)))) |