[Pdns-users] [gmysql] How about add CLIENT_MULTI_RESULTS to smysql.cc ?

Bert Hubert bert.hubert at netherlabs.nl
Mon Mar 21 08:09:33 UTC 2011


I will look into it later today.
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Sandro Tosi <sandro.tosi at register.it> wrote:

Anyone has comment on this patch? Is there a better place I can send it for review and (possible) inclusion? Regards, Sandro On 03/08/2011 04:44 PM, Sandro Tosi wrote: > Hi, > we're configuring to pdns with a MySQL backend, and using stored > procedures to query the database. > > Sadly, we're facing a problem since mysql_real_connect() in smysql.cc > does not have the CLIENT_MULTI_RESULTS argument, needed[1][2] to fetch > multiple rows from a stored proc. > > [1] http://dev.mysql.com/doc/refman/5.5/en/c-api-multiple-queries.html > [2] http://dev.mysql.com/doc/refman/5.5/en/mysql-real-connect.html > > We're about to apply the attached patch and recompile pdns, but I'd like > to hear from you what do you think about it and if you'd like to > consider it for inclusion in the pdns upstream source code. > > Regards, > Sandro > > PS: this is a known problem: > http://old.nabble.com/gmysql-backend-and-stored-procedures-td19035294.html > > > > client_multi_results > > > Index: debian-pdns/modules/gmysqlbackend/smysql.cc >_____________________________________________
> --- debian-pdns.orig/modules/gmysqlbackend/smysql.cc	2011-03-08 15:57:20.000000000 +0100 > +++ debian-pdns/modules/gmysqlbackend/smysql.cc	2011-03-08 15:57:45.000000000 +0100 > @@ -20,7 +20,7 @@ > 			 password.empty() ? 0 : password.c_str(), > 			 database.c_str(), port, > 			 msocket.empty() ? 0 : msocket.c_str(), > -			 0)) { > +			 CLIENT_MULTI_RESULTS)) { > > throw sPerrorException("Unable to connect to database"); > } > @@ -91,6 +91,13 @@ > return true; > } > mysql_free_result(d_rres); > + > + while (mysql_next_result(&d_db) == 0) { > + if (d_rres = mysql_use_result(&d_db)) { > + mysql_free_result(d_rres); > + } > + } > + > d_rres=0; > return false; > } > > > ATT00001.txt > > >_____________________________________________
> Pdns-users mailing list > Pdns-users at mailman.powerdns.com > http://mailman.powerdns.com/mailman/listinfo/pdns-users -- Sandro Tosi Product Engineer Shared Hosting Products R&D | Dada.pro eml sandro.tosi at register.it_____________________________________________
Pdns-users mailing list Pdns-users at mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20110321/a67035c9/attachment-0001.html>


More information about the Pdns-users mailing list