Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- updated error mappings from MDB2

git-svn-id: http://svn.php.net/repository/pear/packages/MDB/trunk@170123 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 575e9d92e7f0a42cc7bc668914c2b3f8219feeb0 1 parent 4ed82da
Lukas Smith authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 MDB/pgsql.php
View
11 MDB/pgsql.php
@@ -123,18 +123,19 @@ function errorCode($errormsg)
static $error_regexps;
if (empty($error_regexps)) {
$error_regexps = array(
- '/([Tt]able does not exist\.|[Rr]elation [\"\'].*[\"\'] does not exist|[Ss]equence does not exist|[Cc]lass ".+" not found)$/' => MDB_ERROR_NOSUCHTABLE,
- '/[Tt]able [\"\'].*[\"\'] does not exist/' => MDB_ERROR_NOSUCHTABLE,
+ '/(([Rr]elation|[Ss]equence|[Tt]able)( [\"\'].*[\"\'])? does not exist|[Cc]lass ".+" not found)$/' => MDB_ERROR_NOSUCHTABLE,
+ '/[Cc]olumn [\"\'].*[\"\'] .*does not exist/' => MDB_ERROR_NOSUCHFIELD,
'/[Rr]elation [\"\'].*[\"\'] already exists|[Cc]annot insert a duplicate key into (a )?unique index.*/' => MDB_ERROR_ALREADY_EXISTS,
- '/divide by zero$/' => MDB_ERROR_DIVZERO,
+ '/(divide|division) by zero$/' => MDB_ERROR_DIVZERO,
'/pg_atoi: error in .*: can\'t parse /' => MDB_ERROR_INVALID_NUMBER,
+ '/invalid input syntax for integer/' => MDB_ERROR_INVALID_NUMBER,
'/ttribute [\"\'].*[\"\'] not found$|[Rr]elation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/' => MDB_ERROR_NOSUCHFIELD,
'/parser: parse error at or near \"/' => MDB_ERROR_SYNTAX,
'/syntax error at/' => MDB_ERROR_SYNTAX,
+ '/permission denied/' => MDB_ERROR_ACCESS_VIOLATION,
'/violates not-null constraint/' => MDB_ERROR_CONSTRAINT_NOT_NULL,
'/violates [\w ]+ constraint/' => MDB_ERROR_CONSTRAINT,
- '/referential integrity violation/' => MDB_ERROR_CONSTRAINT,
- '/deadlock detected/' => MDB_ERROR_DEADLOCK
+ '/referential integrity violation/' => MDB_ERROR_CONSTRAINT
);
}
foreach ($error_regexps as $regexp => $code) {
Please sign in to comment.
Something went wrong with that request. Please try again.