[Serdev] Nested MySQL queries

Jan Janak jan at iptel.org
Mon Sep 19 19:26:43 UTC 2005


On 19-09-2005 21:04, Andreas Granig wrote:
> 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().

  OK, could you check if this is supported by mysqlclient library ? I'll
  try to check the documentation -- i recall that there might be the
  limit of one MYSQL_RES per mysql connection, but I am not completely
  sure about that (maybe this was only true in some old versions of
  mysql).

  We can do it the way you suggest if it works with mysqlclient library.

    Jan.




More information about the Serdev mailing list