From: Chris Hofstaedtler Date: Thu, 12 Dec 2019 18:43:54 +0000 (+0100) Subject: gpgsqlbackend: Avoid actually prepared statements X-Git-Tag: auth-4.3.0-beta1~16^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1da30863accb40ccecbef08b85840963eed715a1;p=thirdparty%2Fpdns.git gpgsqlbackend: Avoid actually prepared statements --- diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index e2052d83f2..43c487214f 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -81,7 +81,7 @@ public: g_log<d_stmt = string("stmt") + std::to_string(d_nstatement); - PGresult* res = PQprepare(d_db(), d_stmt.c_str(), d_query.c_str(), d_nparams, NULL); - ExecStatusType status = PQresultStatus(res); - string errmsg(PQresultErrorMessage(res)); - PQclear(res); - if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK && status != PGRES_NONFATAL_ERROR) { - releaseStatement(); - throw SSqlException("Fatal error during prepare: " + d_query + string(": ") + errmsg); - } paramValues=NULL; d_cur_set=d_paridx=d_residx=d_resnum=d_fnum=0; paramLengths=NULL; @@ -245,7 +229,6 @@ private: } string d_query; - string d_stmt; SPgSQL *d_parent; PGresult *d_res_set; PGresult *d_res;