Details
-
New Feature
-
Status: Open (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Hi!
First of all, an excellent library, a pleasure to work with.
I'm fetching a statement execution result into unrelated C++ types, and i do it row by row via `mysql_stmt_bind_result`
call for each new row like this:
- Create an instance of my C++ type
- set up an array of `MYSQL_BIND` structures to point into that instance
- call `mysql_stmt_bind_result` with that array
- call `mysql_stmt_fetch` and somehow resolve potential truncations with `mysql_stmt_fetch_column` calls
and it works wonders.
Doing some benchmarks i noticed that `mysql_stmt_bind_result` call seems to be very costly, because it copies the whole array into `st_mysql_stmt.bind` field and that `memcpy` shows.
However in my cases this copy is actually redundant and instead of doing 2. and 3. in aforementioned process i can just update the result bind array stored in `st_mysql_stmt` in place, and not only it works just fine, but also allows one to avoid copying binds array for every new row.
Right now i'm accessing that `st_mysql_stmt.bind` field directly, but it would be much more convenient to access it via an API call instead, something in the lines of `mysql_stmt_get_result_bind` or like that.
I do know that `STMT_ATTR_CB_RESULT` exists, however it's not documented and i'm perfectly fine with mariadb-connector-c taking the burden of fetching/parsing data into `MYSQL_BIND` for me.
Attachments
Issue Links
- relates to
-
CONC-348 Add callback support for prepared statement
- Open