diff options
author | Greg Sabino Mullane <greg@users.mediawiki.org> | 2006-11-30 01:00:08 +0000 |
---|---|---|
committer | Greg Sabino Mullane <greg@users.mediawiki.org> | 2006-11-30 01:00:08 +0000 |
commit | 5fbffc3b9eb7f40b51c43f7882f3a6c90577f612 (patch) | |
tree | 690c17bb18a26f73bdc3ea1394e9583a7661c496 /includes/DatabasePostgres.php | |
parent | 21850be40cf422b993aeb8c90f6d1ae672379ddf (diff) | |
download | mediawikicore-5fbffc3b9eb7f40b51c43f7882f3a6c90577f612.tar.gz mediawikicore-5fbffc3b9eb7f40b51c43f7882f3a6c90577f612.zip |
Bring reportQueryError back in sync and support the IGNORE option
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/18016
Diffstat (limited to 'includes/DatabasePostgres.php')
-rw-r--r-- | includes/DatabasePostgres.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 2adc90e8e5c4..d0963af66849 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); + } } /** |