[CONC-549] Add generate_request functions (stmt_execute and bulk_execute) to internal API Created: 2021-05-03  Updated: 2022-07-01

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: 3.4

Type: Task Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When using C/C within python, every api call needs to be encapsulated by BEGIN/END Threads, e.g.

Py_BEGIN_ALLOW_THREADS()
rc= mysql_stmt_execute(self->stmt);
Py_END_ALLOW_THREADS()

This causes a lot of overhead, in case of callback function for filling values was specified: Whenever calling python code inside mysql_stmt_execute() we need to call Py_END_ALLOW_THREADS and Py_BEGIN_ALLOW_THREADS() again.

Instead of it would be much easier to have a call which fills the buffer and another call which executes the stmt:

buffer= self->connection->mysql->methods->generate_execute_request(self->stmt, &buflen)
PY_BEGIN_ALLOW_THREADS()
rc= self-connection->mysql->methods->send_command(COM_STMT_EXECUTE, buffer, buflen, ...)
PY_BEGIN_END_THREADS()

PY_END_ALLOW_THREADS()


Generated at Thu Feb 08 03:06:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.