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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 25 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 14:01:28 2024 UTC