[Serdev] Nested MySQL queries
Andreas Granig
andreas.granig at inode.info
Mon Sep 19 17:16:20 UTC 2005
Hi,
I've reported a problem with nested queries using the mysql module a few
weeks ago. The problem was, that a my_con structure overwrites it's
stored mysql result for each query, so in case of a nested query using
the same my_con the inner query overwrites the result of the outer
query, causing a memory leak (note that it doesn't help to use different
db_con_t because they could internally share the same my_con for a
common db).
Now I've digged a little bit in mysql-module's source code, and the
mysql result stored in the my_con connection is only used in
dbase.c:store_result() and it's called functions.
So is there any reason for not calling mysql_free_result() at the end of
store_result()? Because doing so would allow one to perform nested queries.
Comments?
Andy
More information about the Serdev
mailing list