After execute and fetch result from one prepared SQL statement, how to clear the memory libmysql used
Posted by: zhu zhong hua zhu
Date: February 05, 2016 08:33AM

I have tested mysql prepared statement of executing and fetching, I found that if I execute one prepared sql statement looply, the memory of the program used always increased upwardly. How can I clear the memory libmysql client used? The flollowing is pseduo code:
mysql_init
mysql_real_connect
mysql_stmt_init
mysql_stmt_prepare
for(int i=0; i<10000;i++)
{
mysql_stmt_bind_param
mysql_stmt_execute
mysql_stmt_bind_result
mysql_stmt_store_result
fetch rows looply:
mysql_stmt_fetch
print result
end of loop
mysql_stmt_free_result
}

Options: ReplyQuote


Subject
Views
Written By
Posted
After execute and fetch result from one prepared SQL statement, how to clear the memory libmysql used
2130
February 05, 2016 08:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.