From 363ba04f5ef2e863e2ef129d8ac90b0d85b023a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Wed, 23 Jul 2014 20:13:19 +0200
Subject: [PATCH] only commit in case a transaction is active

---
 lib/private/db/migrator.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/private/db/migrator.php b/lib/private/db/migrator.php
index 6443cf4ed4..d05f845555 100644
--- a/lib/private/db/migrator.php
+++ b/lib/private/db/migrator.php
@@ -110,7 +110,9 @@ class Migrator {
 			$this->dropTable($tmpName);
 		} catch (DBALException $e) {
 			// pgsql needs to commit it's failed transaction before doing anything else
-			$this->connection->commit();
+			if ($this->connection->isTransactionActive()) {
+				$this->connection->commit();
+			}
 			$this->dropTable($tmpName);
 			throw new MigrationException($table->getName(), $e->getMessage());
 		}
-- 
GitLab