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: -
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 3 (66.7%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: edgardmessias at gmail dot com Assigned:
Status: Open Package: PDO Firebird
PHP Version: 7.0.18 OS: All
Private report: No CVE-ID:
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
34 + 7 = ?
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!
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC