From 303e504fcbd9b4b017a0774a62a0e9b65b24b6c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= 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 6443cf4ed48..d05f8455551 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()); } -- 2.39.5