[Kamailio-Devel] MySQL (DB) issue
Henning Westerholt
henning.westerholt at 1und1.de
Mon Jan 5 19:30:16 CET 2009
On Wednesday 10 December 2008, Jeremy Snapcase wrote:
> [..]
> I'll describe what I saw while looking at the MySQL code, but I guess
> this applies to other modules aswell.
>
> db_mysql_store_result(db_con_t* _h, db_res_t** _r)
>
> [ Called for each select query. Converts MySQL resource to db_res_t,
> and frees result ]
>
> -> db_mysql_convert_result
>
> 229 while( mysql_next_result( CON_CONNECTION(_h) ) > 0 ) {
> 230 MYSQL_RES *res = mysql_store_result( CON_CONNECTION(_h) );
> 231 mysql_free_result( res );
> 232 }
To prevent others (and myself) to fall into the same trap again.. ;-)
The quoted code frees not the result for every query, its only executed when
certain stored procedure logic is called. So the db_mysql module does not
free the result to early. But i found a similar issue in the db_unixodbc
module, which i investigate at the moment.
Cheers,
Henning
More information about the Devel
mailing list