[Serdev] Nested MySQL queries
Andreas Granig
andreas.granig at inode.info
Mon Sep 19 19:04:03 UTC 2005
Jan Janak wrote:
>>No, what I mean is storing the MYSQL_RES pointer into a data pointer of
>>db_res_t like it is done with the connection as tail-pointer in db_con_t.
>
>
> I am not sure I understand, the data is gone if you call
> mysql_free_result. The function frees all memory used to hold the
> result.
I think we're talking at cross-purposes :o)
Since we don't want to copy the data from libmysqlclient to the
mysql-module for performance-reasons, I would propose to tie the
MYSQL_RES pointer to the db_res_t instead of the my_con to assure that
each result has it's corresponding MYSQL_RES.
So we could add an extra pointer "data" to the db_res_t where a database
backend could store possible data if needed (the MYSQL_RES pointer in
case of the mysql module). This would also solve the issue that result
data is stored along with the connection, where it logically does not
belong, and where it only causes problems, like in case of nested queries.
The MYSQL_RES is free'd as usual in free_result().
Andy
More information about the Serdev
mailing list