Bug #68351 [Asn->Csd]: PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving
Edit report at https://bugs.php.net/bug.php?id=68351&edit=1
ID: 68351
Updated by: mbeccati@php.net
Reported by: mbeccati@php.net
Summary: PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES
misbehaving
-Status: Assigned
+Status: Closed
Type: Bug
Package: PDO PgSQL
Operating System: *
PHP Version: 5.5Git-2014-11-05 (snap)
Assigned To: mbeccati
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fdc4d8797e176f9bb8d9f9509a45346478d9cc1
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
Previous Comments:
------------------------------------------------------------------------
[2014-11-05 15:04:50] mbeccati@php.net
Description:
------------
The fix for #62593 is not handling non-bool or int values correctly when bound as PDO::PARAM_BOOL.
Test script:
---------------
$db = new PDO("...");
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$query = $db->prepare('SELECT :foo IS FALSE as val_is_false');
$value = '0';
$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
$query->execute();
var_dump($query->fetchColumn());
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68351&edit=1
Thread (3 messages)