Skip to content

Commit fc32956

Browse files
committed
Check server capabilities at the beginning of function
1 parent d3d1cfc commit fc32956

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mariadb/mariadb_codecs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,10 @@ mariadb_get_parameter(MrdbCursor *self,
923923
PyObject *row= NULL,
924924
*column= NULL;
925925
uint8_t rc= 1;
926+
long caps;
927+
928+
mariadb_get_infov(self->connection->mysql,
929+
MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES, &caps);
926930

927931
if (is_bulk)
928932
{
@@ -973,8 +977,7 @@ mariadb_get_parameter(MrdbCursor *self,
973977
/* check if an indicator was passed */
974978
if (MrdbIndicator_Check(column))
975979
{
976-
if (!(self->connection->extended_server_capabilities &
977-
(MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)))
980+
if (!(caps & (MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)))
978981
{
979982
mariadb_throw_exception(NULL, Mariadb_DataError, 0,
980983
"MariaDB %s doesn't support indicator variables. "\
@@ -986,7 +989,7 @@ mariadb_get_parameter(MrdbCursor *self,
986989
param->value= NULL; /* you can't have both indicator and value */
987990
} else if (column == Py_None) {
988991
param->value= NULL;
989-
if (self->connection->extended_server_capabilities &
992+
if (caps &
990993
(MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32))
991994
{
992995
param->indicator= STMT_INDICATOR_NULL;

0 commit comments

Comments
 (0)