Bug #54026 [NEW]: PostgreSQL: cannot bind NULL value to statement
| From: | abrahala at gmail dot com | Date: | Tue, 15 Feb 2011 13:59:37 +0000 |
| Subject: | Bug #54026 [NEW]: PostgreSQL: cannot bind NULL value to statement | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-158788@lists.php.net to get a copy of this message | ||
From:
Operating system: Debian GNU/Linux 2.6.26-2-amd64
PHP version: 5.3.5
Package: PDO related
Bug Type: Bug
Bug description:PostgreSQL: cannot bind NULL value to statement
Description:
------------
It seems to be impossible to pass NULL value to a PDO PostgreSQL statement
neither with bindValue nor using '?'-format and
$statement->execute(array(null)).
Test script:
---------------
$pdo = new PDO('pgsql:host=localhost;port=5432;dbname=db', 'user',
'pass');
$statement = $pdo->prepare('SELECT \'ok\' WHERE NULL IS :nullValue');
$statement->bindValue(':nullValue', null, PDO::PARAM_NULL);
$statement->execute();
$result = $statement->fetchColumn(0);
var_export($result);
Expected result:
----------------
'ok'
Actual result:
--------------
false
--
Edit bug report at http://bugs.php.net/bug.php?id=54026&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54026&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54026&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54026&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54026&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54026&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54026&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54026&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54026&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54026&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54026&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54026&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54026&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54026&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54026&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54026&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54026&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54026&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54026&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54026&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54026&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54026&r=mysqlcfg