PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #2417

[PATCH] Incorrect processing of 'permission denied' style error messages

Details

Submitted2004-09-30 09:12 UTC
Fromstewart at linux dot org dot au
Assigneddanielc
StatusClosed
PackageDB
PHP Version4.3.8
OSDebian
Roadmaps(Not assigned)

Comments

[2004-09-30 09:12 UTC] stewart at linux dot org dot au

Description:
------------
Tried with latest DB package (1.6.7) as well, and the included patch is against this version.

If a query is executed where the native pgsql error code is 'permission denied' it is not translated correctly into a DB_ERROR_ACCESS_VIOLATION error code.

Reproduce code:
---------------
diff -urN DB-1.6.7-orig/DB/pgsql.php DB-1.6.7/DB/pgsql.php
--- DB-1.6.7-orig/DB/pgsql.php 2004-09-26 07:58:00.000000000 +1000
+++ DB-1.6.7/DB/pgsql.php 2004-09-30 18:56:42.947130448 +1000
@@ -254,7 +254,8 @@
'/syntax error at/' => DB_ERROR_SYNTAX,
'/violates not-null constraint/' => DB_ERROR_CONSTRAINT_NOT_NULL,
'/violates [\w ]+ constraint/' => DB_ERROR_CONSTRAINT,
- '/referential integrity violation/' => DB_ERROR_CONSTRAINT
+ '/referential integrity violation/' => DB_ERROR_CONSTRAINT,
+ '/permission denied/' => DB_ERROR_ACCESS_VIOLATION,
);
}
foreach ($error_regexps as $regexp => $code) {

Expected result:
----------------
Error will be correctly reported with above patch.