From 5fbffc3b9eb7f40b51c43f7882f3a6c90577f612 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 30 Nov 2006 01:00:08 +0000 Subject: [PATCH] Bring reportQueryError back in sync and support the IGNORE option --- includes/DatabasePostgres.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 2adc90e8e5..d0963af668 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -673,11 +673,21 @@ class DatabasePostgres extends Database { function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { - $message = "A database error has occurred\n" . - "Query: $sql\n" . - "Function: $fname\n" . - "Error: $errno $error\n"; - throw new DBUnexpectedError($this, $message); + # Ignore errors during error handling to avoid infinite recursion + $ignore = $this->ignoreErrors( true ); + ++$this->mErrorCount; + + if ($ignore || $tempIgnore) { + wfDebug("SQL ERROR (ignored): $error\n"); + $this->ignoreErrors( $ignore ); + } + else { + $message = "A database error has occurred\n" . + "Query: $sql\n" . + "Function: $fname\n" . + "Error: $errno $error\n"; + throw new DBUnexpectedError($this, $message); + } } /** -- 2.20.1