[lua-dbi] Added upstream patch to avoid PostgreSQL transaction warnings

Robert Scheck robert at fedoraproject.org
Fri Apr 26 21:07:17 UTC 2013


commit 3728e5de6f7d1d375c017e18af6cc1a1f651ac66
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Fri Apr 26 23:07:09 2013 +0200

    Added upstream patch to avoid PostgreSQL transaction warnings

 lua-dbi-0.5-pgsql_transaction.patch |   27 +++++++++++++++++++++++++++
 lua-dbi.spec                        |    7 ++++++-
 2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/lua-dbi-0.5-pgsql_transaction.patch b/lua-dbi-0.5-pgsql_transaction.patch
new file mode 100644
index 0000000..877c36a
--- /dev/null
+++ b/lua-dbi-0.5-pgsql_transaction.patch
@@ -0,0 +1,27 @@
+Make calling autocommit with the same value as set a NOOP to suppress the warning
+
+  WARNING:  there is already a transaction in progress
+
+from the PostgreSQL database (e.g. in prosody or prosodyctl). See also upstream commit:
+
+https://code.google.com/p/luadbi/source/detail?r=aab3ed7d93fe9b10b75e302c787737999a8b4a5f
+
+--- lua-dbi-0.5/dbd/postgresql/connection.c			2010-05-01 06:25:12.000000000 +0200
++++ lua-dbi-0.5/dbd/postgresql/connection.c.pgsql_transaction	2013-04-26 02:02:31.000000000 +0200
+@@ -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;	
+     }
diff --git a/lua-dbi.spec b/lua-dbi.spec
index 437581e..dc8ffb8 100644
--- a/lua-dbi.spec
+++ b/lua-dbi.spec
@@ -6,7 +6,7 @@
 
 Name:           lua-dbi
 Version:        0.5
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Database interface library for Lua
 
 Group:          Development/Libraries
@@ -14,6 +14,7 @@ License:        MIT
 URL:             http://code.google.com/p/%{real_name}
 Source0:        http://%{real_name}.googlecode.com/files/%{real_name}.%{version}.tar.gz
 Patch0:         %{name}-RH-build.patch
+Patch1:         %{name}-0.5-pgsql_transaction.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  lua-devel, mysql-devel, sqlite-devel, postgresql-devel
@@ -36,6 +37,7 @@ with native database drivers.
 %prep
 %setup -q -c
 %patch0 -p1 -b .RH-build
+%patch1 -p1 -b .pgsql_transaction
 find . -name \*.[ch] -print -exec chmod -x '{}' \;
 
 %build
@@ -64,6 +66,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Apr 26 2013 Robert Scheck <robert at fedoraproject.org> - 0.5-5
+- Added upstream patch to avoid PostgreSQL transaction warnings
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list