rdbms: make Database query error handling more strict
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DatabasePostgres.php
index e3dd3d0..9ffcc8b 100644 (file)
@@ -248,25 +248,6 @@ class DatabasePostgres extends Database {
                }
        }
 
-       public function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
-               if ( $tempIgnore ) {
-                       /* Check for constraint violation */
-                       if ( $errno === '23505' ) {
-                               parent::reportQueryError( $error, $errno, $sql, $fname, $tempIgnore );
-
-                               return;
-                       }
-               }
-               /* Transaction stays in the ERROR state until rolled back */
-               if ( $this->trxLevel ) {
-                       // Throw away the transaction state, then raise the error as normal.
-                       // Note that if this connection is managed by LBFactory, it's already expected
-                       // that the other transactions LBFactory manages will be rolled back.
-                       $this->rollback( __METHOD__, self::FLUSHING_INTERNAL );
-               }
-               parent::reportQueryError( $error, $errno, $sql, $fname, false );
-       }
-
        public function freeResult( $res ) {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
@@ -821,6 +802,10 @@ __INDEXATTR__;
                return in_array( $errno, $codes, true );
        }
 
+       protected function wasKnownStatementRollbackError() {
+               return false; // transaction has to be rolled-back from error state
+       }
+
        public function duplicateTableStructure(
                $oldName, $newName, $temporary = false, $fname = __METHOD__
        ) {