diff options
author | Bjorn Munch <Bjorn.Munch@sun.com> | 2010-01-06 09:45:28 +0100 |
---|---|---|
committer | Bjorn Munch <Bjorn.Munch@sun.com> | 2010-01-06 09:45:28 +0100 |
commit | 08c8863ec41b1168d69f4d78db9bc0606e36f2ad (patch) | |
tree | 76250df643cfa75e84e592c97804aa7178e0e670 /client | |
parent | 5b66dab00f9f7456632911a41c2b8f701cb21264 (diff) | |
download | mariadb-git-08c8863ec41b1168d69f4d78db9bc0606e36f2ad.tar.gz |
Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Set a flag after send to trap the case
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index f516415f15d..804db8fbefe 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -228,6 +228,8 @@ struct st_connection char *name; size_t name_len; MYSQL_STMT* stmt; + /* Set after send to disallow other queries before reap */ + my_bool pending; #ifdef EMBEDDED_LIBRARY const char *cur_query; @@ -4691,7 +4693,8 @@ void do_close_connection(struct st_command *command) if (con->util_mysql) mysql_close(con->util_mysql); con->util_mysql= 0; - + con->pending= FALSE; + my_free(con->name, MYF(0)); /* @@ -6513,6 +6516,9 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, if (flags & QUERY_SEND_FLAG) { + if (cn->pending) + die ("Cannot run query on connection between send and reap"); + /* Send the query */ @@ -6532,8 +6538,11 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, wait_query_thread_end(cn); #endif /*EMBEDDED_LIBRARY*/ if (!(flags & QUERY_REAP_FLAG)) + { + cn->pending= TRUE; DBUG_VOID_RETURN; - + } + do { /* @@ -6622,6 +6631,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, end: + cn->pending= FALSE; /* We save the return code (mysql_errno(mysql)) from the last call sent to the server into the mysqltest builtin variable $mysql_errno. This |