From: Greg Sabino Mullane Date: Thu, 30 Nov 2006 01:00:08 +0000 (+0000) Subject: Bring reportQueryError back in sync and support the IGNORE option X-Git-Tag: 1.31.0-rc.0~55029 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=5fbffc3b9eb7f40b51c43f7882f3a6c90577f612;p=lhc%2Fweb%2Fwiklou.git Bring reportQueryError back in sync and support the IGNORE option --- 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); + } } /**