Fix for CONPY-251

Check if stmt was already initialized in cursor method
nextset().
This commit is contained in:
Georg Richter
2023-02-12 08:26:37 +01:00
parent 49b49083a2
commit 0c844879fd
3 changed files with 15 additions and 2 deletions

View File

@ -900,9 +900,14 @@ MrdbCursor_nextset(MrdbCursor *self)
return NULL;
}
MARIADB_BEGIN_ALLOW_THREADS(self->connection);
if (!self->parseinfo.is_text)
{
if (!self->stmt)
Py_RETURN_NONE;
MARIADB_BEGIN_ALLOW_THREADS(self->connection);
rc= mysql_stmt_next_result(self->stmt);
MARIADB_END_ALLOW_THREADS(self->connection);
}
else
{
if (self->result)
@ -910,9 +915,10 @@ MrdbCursor_nextset(MrdbCursor *self)
mysql_free_result(self->result);
self->result= NULL;
}
MARIADB_BEGIN_ALLOW_THREADS(self->connection);
rc= mysql_next_result(self->connection->mysql);
MARIADB_END_ALLOW_THREADS(self->connection);
}
MARIADB_END_ALLOW_THREADS(self->connection);
if (rc)
{