Merge "rdbms: Remove support for PostgreSQL < 9.2, and improve INSERT IGNORE for...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 5 Apr 2018 21:33:26 +0000 (21:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Apr 2018 21:33:26 +0000 (21:33 +0000)
1  2 
includes/libs/rdbms/database/Database.php

@@@ -1145,19 -1145,12 +1145,14 @@@ abstract class Database implements IDat
                                        # In the first case, the only options going forward are (a) ROLLBACK, or
                                        # (b) ROLLBACK TO SAVEPOINT (if one was set). If the later case, the only
                                        # option is ROLLBACK, since the snapshots would have been released.
-                                       if ( is_object( $tempIgnore ) ) {
-                                               // Ugly hack to know that savepoints are in use for postgres
-                                               // FIXME: remove this and make DatabasePostgres use ATOMIC_CANCELABLE
-                                       } else {
-                                               $this->trxStatus = self::STATUS_TRX_ERROR;
-                                               $this->trxStatusCause =
-                                                       $this->makeQueryException( $lastError, $lastErrno, $sql, $fname );
-                                               $tempIgnore = false; // cannot recover
-                                       }
+                                       $this->trxStatus = self::STATUS_TRX_ERROR;
+                                       $this->trxStatusCause =
+                                               $this->makeQueryException( $lastError, $lastErrno, $sql, $fname );
+                                       $tempIgnore = false; // cannot recover
                                } else {
 -                                      # Nothing prior was there to lose from the transaction
 +                                      # Nothing prior was there to lose from the transaction,
 +                                      # so just roll it back.
 +                                      $this->doRollback( __METHOD__ . " ($fname)" );
                                        $this->trxStatus = self::STATUS_TRX_OK;
                                }
                        }