From: php at sagi dot org
Operating system: Linux
PHP version: 5CVS-2005-07-27 (dev)
PHP Bug Type: PDO related
Bug description: PDO misquotes/miscasts bool(false)
Description:
------------
Running latest php5 snapshot (php5-200507261230), PDO connected to pgsql
8.0 server.
I'm trying to run a query similar to this:
$res = $db->prepare('SELECT id FROM table WHERE mybool = ?');
$res->execute(array(false));
PDO throws this exception: 'SQLSTATE[22P02]: Invalid text representation:
7 ERROR: invalid input syntax for type boolean: ""'
The query that has been executed, according to the server log, is: "SELECT
id FROM table WHERE mybool = ''"
Which is obviously not right. When trying to run the same query with
bool(true) parameter, PDO correctly quotes it as '1'.
--
Edit bug report at http://bugs.php.net/?id=33876&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33876&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33876&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33876&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33876&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33876&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33876&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33876&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33876&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33876&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33876&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33876&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33876&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33876&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33876&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33876&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33876&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33876&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33876&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33876&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33876&r=mysqlcfg