php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74462 PDO_Firebird returns only NULLs for results with boolean for FIREBIRD >= 3.0
Submitted: 2017-04-17 19:14 UTC Modified: 2018-07-03 18:05 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 4 (75.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: edgardmessias at gmail dot com Assigned: ab (profile)
Status: Closed Package: PDO Firebird
PHP Version: 7.0.18 OS: All
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: edgardmessias at gmail dot com
New email:
PHP Version: OS:

 

 [2017-04-17 19:14 UTC] edgardmessias at gmail dot com
Description:
------------
From the version of FIREBIRD 3.0.0, Boolean type support was introduced (https://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-ddl-enhance.html#rnfb30-ddl-boolean)

Currently, the PDO returns only null values for Boolean columns

Test script:
---------------
CREATE TABLE TBOOL (ID INT, BVAL BOOLEAN);
COMMIT;

INSERT INTO TBOOL VALUES (1, TRUE);
INSERT INTO TBOOL VALUES (2, 2 = 4);
INSERT INTO TBOOL VALUES (3, NULL = 1);
COMMIT;

<php
$pdo = new \PDO('firebird:dbname=localhost:/tmp/TEST.FDB', 'SYSDBA', 'masterkey', array(
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_CASE    => PDO::CASE_LOWER,
        ));

$stmt = $pdo->prepare("SELECT * FROM TBOOL");
$stmt->execute();
$rows = $stmt->fetchAll();
var_dump($rows);


Expected result:
----------------
          ID    BVAL
============ =======
           1 <true>
           2 <false>
           3 <null>

Actual result:
--------------
          ID    BVAL
============ =======
           1 <null>
           2 <null>
           3 <null>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-13 14:41 UTC] dorin dot marcoci at gmail dot com
Here is the fix: https://github.com/php/php-src/pull/2522
Testers are welcome!
 [2018-07-03 18:05 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2018-07-03 18:05 UTC] ab@php.net
The linked PR was merged in 7.3.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC