Skip to content

Commit

Permalink
Fix for CONC-178:
Browse files Browse the repository at this point in the history
When a cursor was not properly cleared (all results weren't
fetched) the clear_result routine has to free result sets only
if field_count > 0.
  • Loading branch information
9EOR9 committed Nov 25, 2021
1 parent eb48926 commit 5831a69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mariadb/mariadb_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,14 @@ PyObject *MrdbCursor_clear_result(MrdbCursor *self)
self->stmt)
{
/* free current result */
mysql_stmt_free_result(self->stmt);
if (mysql_stmt_field_count(self->stmt))
mysql_stmt_free_result(self->stmt);

/* check if there are more pending result sets */
while (mysql_stmt_next_result(self->stmt) == 0)
{
mysql_stmt_free_result(self->stmt);
if (mysql_stmt_field_count(self->stmt))
mysql_stmt_free_result(self->stmt);
}
} else if (self->parseinfo.is_text)
{
Expand Down

0 comments on commit 5831a69

Please sign in to comment.