Skip to content

Commit

Permalink
Avoid access internal members of the mysql structure:
Browse files Browse the repository at this point in the history
Instead of accessing stmt->mysql->server_status we need to obtain the
sever status via mariadb_get_infov() function.
  • Loading branch information
9EOR9 committed Jul 15, 2020
1 parent c6ad169 commit 7d4ff26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion benchmarks/benchmark/bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

def bulk(loops, conn):
cursor = conn.cursor()
cursor.execute("DROP TABLE IF EXISTS test_update_bulk")
cursor.execute("CREATE TEMPORARY TABLE test_update_bulk (a int primary key, b int)")
# conn.autocommit= False
t0 = pyperf.perf_counter()
Expand Down
11 changes: 7 additions & 4 deletions src/mariadb_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,12 +1538,15 @@ static PyObject *
MrdbCursor_sp_outparams(MrdbCursor *self)
{
if (!self->is_closed && self->stmt &&
self->stmt->mysql &&
(self->stmt->mysql->server_status & SERVER_PS_OUT_PARAMS))
self->stmt->mysql)
{
Py_RETURN_TRUE;
uint32_t server_status;
mariadb_get_infov(self->stmt->mysql, MARIADB_CONNECTION_SERVER_STATUS, &server_status);
if (server_status & SERVER_PS_OUT_PARAMS)
{
Py_RETURN_TRUE;
}
}

Py_RETURN_FALSE;
}

Expand Down

0 comments on commit 7d4ff26

Please sign in to comment.