mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
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.
This commit is contained in:
parent
122f5f6cd0
commit
e235ccd13a
1 changed files with 6 additions and 0 deletions
|
@ -1673,6 +1673,7 @@ static int
|
||||||
run_statements(MYSQL *mysql, statement *stmt)
|
run_statements(MYSQL *mysql, statement *stmt)
|
||||||
{
|
{
|
||||||
statement *ptr;
|
statement *ptr;
|
||||||
|
MYSQL_RES *result;
|
||||||
DBUG_ENTER("run_statements");
|
DBUG_ENTER("run_statements");
|
||||||
|
|
||||||
for (ptr= stmt; ptr && ptr->length; ptr= ptr->next)
|
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));
|
my_progname, (uint)ptr->length, ptr->string, mysql_error(mysql));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
if (mysql_field_count(mysql))
|
||||||
|
{
|
||||||
|
result= mysql_store_result(mysql);
|
||||||
|
mysql_free_result(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
Loading…
Reference in a new issue