Make calling autocommit with the same value as set a NOOP to suppress a warning from the DB

Fri, 24 Dec 2010 00:34:04 +0000

author
nrich@ii.net
date
Fri, 24 Dec 2010 00:34:04 +0000
changeset 44
aab3ed7d93fe
parent 43
356dcb1d455c
child 45
7c968f66bccd

Make calling autocommit with the same value as set a NOOP to suppress a warning from the DB

dbd/postgresql/connection.c file | annotate | diff | comparison | revisions
--- a/dbd/postgresql/connection.c	Mon Dec 20 23:03:00 2010 +0000
+++ b/dbd/postgresql/connection.c	Fri Dec 24 00:34:04 2010 +0000
@@ -109,10 +109,12 @@
     int err = 0;
 
     if (conn->postgresql) {
-	if (on)
-	    err = rollback(conn);
-	else
-	    err = begin(conn);
+	if (on != conn->autocommit) {
+	    if (on)
+		err = rollback(conn);
+	    else
+		err = begin(conn);
+	}
 
 	conn->autocommit = on;	
     }

mercurial