Ignore:
Timestamp:
09/26/13 15:41:49 (11 years ago)
Author:
angelo
Message:

Ticket #3491 - Compatibilizar Expresso com novas versoes do PHP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/adodb-error.inc.php

    r34 r8222  
    11<?php 
    22/**  
    3  * @version V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 
     3 * @version V5.18 3 Sep 2012  (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. 
    44 * Released under both BSD license and Lesser GPL library license.  
    55 * Whenever there is any discrepancy between the two licenses,  
     
    4242        define("DB_ERROR_NOSUCHDB",           -25); 
    4343        define("DB_ERROR_ACCESS_VIOLATION",   -26); 
     44        define("DB_ERROR_DEADLOCK",           -27); 
     45        define("DB_ERROR_STATEMENT_TIMEOUT",  -28); 
     46        define("DB_ERROR_SERIALIZATION_FAILURE", -29); 
    4447} 
    4548 
     
    9295{ 
    9396        if (is_numeric($errormsg)) return (integer) $errormsg; 
     97        // Postgres has no lock-wait timeout.  The best we could do would be to set a statement timeout. 
    9498    static $error_regexps = array( 
    95             '/(Table does not exist\.|Relation [\"\'].*[\"\'] does not exist|sequence does not exist|class ".+" not found)$/' => DB_ERROR_NOSUCHTABLE, 
    96             '/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*/'      => DB_ERROR_ALREADY_EXISTS, 
    97             '/divide by zero$/'                     => DB_ERROR_DIVZERO, 
    98             '/pg_atoi: error in .*: can\'t parse /' => DB_ERROR_INVALID_NUMBER, 
    99             '/ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/' => DB_ERROR_NOSUCHFIELD, 
    100             '/parser: parse error at or near \"/'   => DB_ERROR_SYNTAX, 
    101             '/referential integrity violation/'     => DB_ERROR_CONSTRAINT, 
    102                         '/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key violates unique constraint/'      
    103                                  => DB_ERROR_ALREADY_EXISTS 
     99            '/(Table does not exist\.|Relation [\"\'].*[\"\'] does not exist|sequence does not exist|class ".+" not found)$/i' => DB_ERROR_NOSUCHTABLE, 
     100            '/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*|duplicate key.*violates unique constraint/i'     => DB_ERROR_ALREADY_EXISTS, 
     101            '/database ".+" does not exist$/i'       => DB_ERROR_NOSUCHDB, 
     102            '/(divide|division) by zero$/i'          => DB_ERROR_DIVZERO, 
     103            '/pg_atoi: error in .*: can\'t parse /i' => DB_ERROR_INVALID_NUMBER, 
     104            '/ttribute [\"\'].*[\"\'] not found|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/i' => DB_ERROR_NOSUCHFIELD, 
     105            '/(parser: parse|syntax) error at or near \"/i'   => DB_ERROR_SYNTAX, 
     106            '/referential integrity violation/i'     => DB_ERROR_CONSTRAINT, 
     107            '/deadlock detected$/i'                  => DB_ERROR_DEADLOCK, 
     108            '/canceling statement due to statement timeout$/i' => DB_ERROR_STATEMENT_TIMEOUT, 
     109            '/could not serialize access due to/i'   => DB_ERROR_SERIALIZATION_FAILURE 
    104110        ); 
    105111        reset($error_regexps); 
Note: See TracChangeset for help on using the changeset viewer.