php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77863 PDO firebird support type Boolean in input parameters
Submitted: 2019-04-07 11:42 UTC Modified: -
From: sim-mail at list dot ru Assigned:
Status: Open Package: PDO Firebird
PHP Version: 7.3.4 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-04-07 11:42 UTC] sim-mail at list dot ru
Description:
------------
PDO firebird does not support type Boolean in input parameters

Test script:
---------------
$sql = <<<SQL
with t(b, s) as (
  select true, 'true' from rdb\$database
  union all
  select false, 'false' from rdb\$database
  union all
  select unknown, 'unknown' from rdb\$database
)
select trim(s) as s from t where b is not distinct from :p
SQL;

require 'testdb.inc';
$db = new PDO('firebird:dbname='.$test_base, $user, $password) or die;
try { 
  // PDO::PARAM_BOOL

  $query = $db->prepare($sql);
  
  $query->bindValue('p', 0, PDO::PARAM_BOOL);
  $query->execute();
  var_dump($query->fetchColumn(0));  
  
  $query->bindValue('p', 1, PDO::PARAM_BOOL);
  $query->execute();
  var_dump($query->fetchColumn(0));  
  
  $query->bindValue('p', false, PDO::PARAM_BOOL);
  $query->execute();
  var_dump($query->fetchColumn(0));   
  
  $query->bindValue('p', true, PDO::PARAM_BOOL);
  $query->execute();
  var_dump($query->fetchColumn(0));     
  echo "OK\n";
}
catch(Exception $e) {
	echo $e->getMessage() . '<br>';
	echo $e->getTraceAsString();
}

Expected result:
----------------
string(5) "false"
string(4) "true"
string(5) "false"
string(4) "true"
OK


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-07 12:12 UTC]
The following pull request has been associated:

Patch Name:  Request #77863 Add support boolean datatype for PDO Firebird in input parameters
On GitHub:  https://github.com/php/php-src/pull/4014
Patch:      https://github.com/php/php-src/pull/4014.patch
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 02:01:25 2019 UTC