Mysql_store_result () @MySQL C API - does it really allocate memory in every call?

I read that mysql_store_result () in the MySQL C API will allocate memory for each call to it;

mysql_store_result() reads the entire result of a query to the client, allocates a MYSQL_RES structure, and places the result into this structure.

Is this really so? I ask because I am going to call it many times in a server application. Allocation / release is terrible for my purpose.

Is there any way to provide it with a special buffer? Maybe some kind of "undocumented" API?

+3
source share
2 answers

Check out this link about using mysql_use_result: http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html

"use_result" "store_result" .

+2

, . ?

, : " ?" " ?" , , .

0

Source: https://habr.com/ru/post/1735538/


All Articles