php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68351 PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving
Submitted: 2014-11-05 15:04 UTC Modified: 2014-11-05 15:05 UTC
From: mbeccati@php.net Assigned: mbeccati
Status: Closed Package: PDO PgSQL
PHP Version: 5.5Git-2014-11-05 (snap) OS: *
Private report: No CVE-ID:
 [2014-11-05 15:04 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-05 15:05 UTC] mbeccati@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mbeccati
 [2014-11-06 15:38 UTC] mbeccati@php.net
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)
 [2014-11-06 15:38 UTC] mbeccati@php.net
-Status: Assigned +Status: Closed
 [2014-11-06 15:38 UTC] mbeccati@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fccf0bac9eab67412612b2df14da58b9129c6b2
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 [2014-11-06 15:38 UTC] mbeccati@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f5130c3058133c6919673b5e0eb4f59a98921946
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 [2014-11-07 06:57 UTC] dmitry@php.net
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)
 [2014-11-07 06:57 UTC] dmitry@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fccf0bac9eab67412612b2df14da58b9129c6b2
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 [2014-11-18 20:34 UTC] ab@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f5130c3058133c6919673b5e0eb4f59a98921946
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 [2014-11-18 20:34 UTC] ab@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fccf0bac9eab67412612b2df14da58b9129c6b2
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 [2014-11-18 20:34 UTC] ab@php.net
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)
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of mbeccati
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f5130c3058133c6919673b5e0eb4f59a98921946
Log: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Mon Apr 24 16:01:44 2017 UTC