#22221 [Asn->Csd]: bad rows count in the result object for postgresql

From: Date: Wed, 19 Feb 2003 13:33:17 +0000
Subject: #22221 [Asn->Csd]: bad rows count in the result object for postgresql
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-33557@lists.php.net to get a copy of this message
 ID:               22221
 Updated by:       mboeren@php.net
 Reported By:      alex dot madon at bestlinuxjobs dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         DBX related
 Operating System: Linux morlupo 2.4.18-14 (redhat
 PHP Version:      4.2.2
 Assigned To:      mboeren
 New Comment:

Fixed.


Previous Comments:
------------------------------------------------------------------------

[2003-02-14 09:47:29] alex dot madon at bestlinuxjobs dot com

Marc:
I am trying to run the tests (compile the cgi version).
I'll tell you the results of the tests if any.
Alex

------------------------------------------------------------------------

[2003-02-14 09:16:36] mboeren@php.net

The same error would have occurrred in the latest version too. The
patch I sent solves the problem, and should have no side-effects. I
would like to run the dbx-tests before I commit the patch to cvs
though.


------------------------------------------------------------------------

[2003-02-14 09:07:45] alex dot madon at bestlinuxjobs dot com

Hi Iliia,

Marc sent me a patch that solved the problem.

------------------------------------------------------------------------

[2003-02-14 08:58:43] iliaa@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2003-02-14 07:26:47] alex dot madon at bestlinuxjobs dot com

Hello Marc,
Thank you for replying so fast.

I don't think my setup is very specific.
Here is the code of my error handler.
(Note that the work around I have found is to regexp the $errormesg: I
didn't want to leave completely the E_WARNING completely as a SQL
syntax error will be unnoticed by me. Strangely a SQL syntax erro comes
out with the same error code E_WARNING as this postgresql "bug")
I don't know how the default handler do, but it catches the SQL errors
but not this postgresql stuff.... perhaps does the same thing: parse
for ERROR)


---- here is the code-----
function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars)
{
    # define an assoc array of error string
    # in reality the only entries we should
    # consider are 2,8,256,512 and 1024
    $errortype = array (
			1   => "Error",
			2   => "Warning",
			4   => "Parsing Error",
			8   => "Notice",
			16  => "Core Error",
			32  => "Core Warning",
			64  => "Compile Error",
			128 => "Compile Warning",
			256 => "User Error",
			512 => "User Warning",
			1024=> "User Notice"
			);

    # set of errors for which we will die
    $die_errors = array(E_USER_ERROR);
    
    # set of errors that will be mailed
    $mail_errors =
array(E_ERROR,E_WARNING,E_PARSE,E_CORE_ERROR,E_CORE_WARNING,E_USER_ERROR,
E_USER_WARNING);
    
    
    $err.=$errortype["$errno"]." (bit $errno)\n$errmsg\nin $filename
line $linenum";
    
    if (in_array($errno, $mail_errors) &&
preg_match("/ERROR/",$errmsg)) {
	myerrormail("error@bestlinuxjobs.com",$errortype["$errno"]." (bit
$errno)",$err);
    }
    #possibly die
    if (in_array($errno, $die_errors)){
        exit;
    }
    return 1;
}

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22221

-- 
Edit this bug report at http://bugs.php.net/?id=22221&edit=1



Thread (10 messages)

« previous php.bugs (#33557) next »