]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove transaction in pgpsql backend
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 7 Mar 2017 07:59:17 +0000 (08:59 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 7 Apr 2017 18:20:26 +0000 (20:20 +0200)
modules/gpgsqlbackend/spgsql.cc

index 22eaf0e0483f6def4924d88a9e41a163928fdf60..52a3da8018392dc30f2411066671b889c3209e0f 100644 (file)
@@ -45,7 +45,6 @@ public:
     d_res_set = NULL;
     paramValues = NULL;
     paramLengths = NULL;
-    d_do_commit = false;
     d_nstatement = nstatement;
     d_paridx = 0;
     d_residx = 0;
@@ -81,11 +80,6 @@ public:
     if (d_dolog) {
       L<<Logger::Warning<<"Query: "<<d_query<<endl;
     }
-    if (!d_parent->in_trx()) {
-      auto res=PQexec(d_db(),"BEGIN");
-      PQclear(res);
-      d_do_commit = true;
-    } else d_do_commit = false;
     d_res_set = PQexecPrepared(d_db(), d_stmt.c_str(), d_nparams, paramValues, paramLengths, NULL, 0);
     ExecStatusType status = PQresultStatus(d_res_set);
     string errmsg(PQresultErrorMessage(d_res_set));
@@ -175,11 +169,6 @@ public:
 
   SSqlStatement* reset() {
      int i;
-     if (!d_parent->in_trx() && d_do_commit) {
-       PGresult *res = PQexec(d_db(),"COMMIT");
-       PQclear(res);
-     }
-     d_do_commit = false;
      if (d_res)
        PQclear(d_res);
      if (d_res_set)
@@ -235,7 +224,6 @@ private:
     paramLengths=NULL;
     d_res=NULL;
     d_res_set=NULL;
-    d_do_commit=false;
     d_prepared = true;
   }
 
@@ -262,7 +250,6 @@ private:
   int d_resnum;
   int d_fnum;
   int d_cur_set;
-  bool d_do_commit;
   unsigned int d_nstatement;
 };