From:             dmitry dot vasilev at gmail dot com
Operating system: FreeBSD 8.2
PHP version:      5.4.11
Package:          PDO related
Bug Type:         Bug
Bug description:errorInfo doesn't cleans up properly

Description:
------------
Affects at least PgSQL driver (MySQL works fine). 

Workflow:
1. Make invalid query - errorInfo()[2] contains error info. Error code is
not 
zero.
2. Make valid query - errorInfo()[2] still contains an error from the first
step 
(but error code is 0).

pdo_pgsql:
libpq version 9.0.8
Module version: 1.0.2


Test script:
---------------
$pdo->exec("SELECT * FROM bad_table;");
echo $pdo->errorInfo()[2]; // "relation bad_table doesn't exist"

$pdo->exec("SELECT * FROM good_table;");
echo $pdo->errorInfo()[2]; // "relation bad_table doesn't exist". Expected
"".

Expected result:
----------------
""

Actual result:
--------------
"relation bad_table doesn't exist"

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64172&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64172&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64172&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64172&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64172&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64172&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64172&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64172&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64172&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64172&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64172&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64172&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64172&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64172&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64172&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64172&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64172&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64172&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64172&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64172&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64172&r=mysqlcfg

Reply via email to