[Pdns-users] [gmysql] How about add CLIENT_MULTI_RESULTS to smysql.cc ?
bert hubert
bert.hubert at netherlabs.nl
Tue Mar 22 14:19:30 UTC 2011
On Mon, Mar 21, 2011 at 08:35:15AM +0100, Sandro Tosi wrote:
> Anyone has comment on this patch? Is there a better place I can send
> it for review and (possible) inclusion?
Hi Sandro,
It has been added to revision 2084, which can be downloaded from
http://powerdnssec.org/snapshots/
It will also be part of the 3.0 release.
Thanks!
>
> 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
>
More information about the Pdns-users
mailing list