]> source.dussan.org Git - nextcloud-server.git/commitdiff
only commit in case a transaction is active
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 23 Jul 2014 18:13:19 +0000 (20:13 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 23 Jul 2014 18:13:19 +0000 (20:13 +0200)
lib/private/db/migrator.php

index 6443cf4ed48a14d47e0092450c2e8cded9ab74f7..d05f8455551faead79c2189e03c33aa7550fd4a7 100644 (file)
@@ -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());
                }