#44597 [NEW]: Postgres driver does not prepare booleans correctly
| From: | kenaniah at gmail dot com | Date: | Tue, 01 Apr 2008 21:00:50 +0000 |
| Subject: | #44597 [NEW]: Postgres driver does not prepare booleans correctly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-123834@lists.php.net to get a copy of this message | ||
From: kenaniah at gmail dot com
Operating system: Red Hat 4.1.1
PHP version: 5.2.5
PHP Bug Type: PDO related
Bug description: Postgres driver does not prepare booleans correctly
Description:
------------
When using postgres via PDO and attempting to execute an INSERT or UPDATE
query using $stmt->execute(array_values($data)) syntax, postgres returns an
error for any boolean fields that may be present.
Reproduce code:
---------------
<?php
// $db is my PDO connection object
$values = array(true, false);
$sql = "UPDATE table SET boolean_column1 = ?, boolean_column2 = ?";
$stmt = $db->prepare($sql);
$stmt->execute($values);
?>
Expected result:
----------------
PDO will recognize that the values in the array are boolean, and will
provide these values to the prepared statement as correctly-formatted
booleans.
Actual result:
--------------
PostgreSQL 8.1.9 returns an error stating that the provided values for the
booleans are not in the correct format, and may need to be type-casted.
--
Edit bug report at http://bugs.php.net/?id=44597&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44597&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44597&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44597&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44597&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44597&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44597&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44597&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44597&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44597&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44597&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44597&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44597&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44597&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44597&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44597&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44597&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44597&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44597&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44597&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44597&r=mysqlcfg