summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-23 20:13:19 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-23 20:13:19 +0200
commit363ba04f5ef2e863e2ef129d8ac90b0d85b023a6 (patch)
treeb40cc108ab589e90f69f111124131f082da65312 /lib/private/db
parenta547bf8fe6f05d6ca797b1944178de526a038cb2 (diff)
downloadnextcloud-server-363ba04f5ef2e863e2ef129d8ac90b0d85b023a6.tar.gz
nextcloud-server-363ba04f5ef2e863e2ef129d8ac90b0d85b023a6.zip
only commit in case a transaction is active
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/migrator.php4
1 files changed, 3 insertions, 1 deletions
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());
}