diff options
author | unknown <brian@zim.(none)> | 2007-09-04 20:03:12 -0700 |
---|---|---|
committer | unknown <brian@zim.(none)> | 2007-09-04 20:03:12 -0700 |
commit | 700d8b1f09073cdefc46513ba4eb8a81bcaa4808 (patch) | |
tree | 27fdcaf85c17adff39b3d3d11753d674f6409f67 /client | |
parent | 943ed8fe354734fa52417bf36920462ab23756d3 (diff) | |
download | mariadb-git-700d8b1f09073cdefc46513ba4eb8a81bcaa4808.tar.gz |
Discovered a bug while working with backup. Since it is possible to execute a statement in a pre/post statment clause that can return a result, we need to test for that and free it.
client/mysqlslap.c:
Cleanup resuls if rows are returned.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlslap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index af29df6e4ba..02a0cbd04c5 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1673,6 +1673,7 @@ static int run_statements(MYSQL *mysql, statement *stmt) { statement *ptr; + MYSQL_RES *result; DBUG_ENTER("run_statements"); for (ptr= stmt; ptr && ptr->length; ptr= ptr->next) @@ -1683,6 +1684,11 @@ run_statements(MYSQL *mysql, statement *stmt) my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql)); exit(1); } + if (mysql_field_count(mysql)) + { + result= mysql_store_result(mysql); + mysql_free_result(result); + } } DBUG_RETURN(0); |