Bug #74462 [Com]: PDO_Firebird returns only NULLs for results with boolean for FIREBIRD >= 3.0

From: Date: Sat, 13 May 2017 14:41:41 +0000
Subject: Bug #74462 [Com]: PDO_Firebird returns only NULLs for results with boolean for FIREBIRD >= 3.0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209096@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74462&edit=1

 ID:                 74462
 Comment by:         dorin dot marcoci at gmail dot com
 Reported by:        edgardmessias at gmail dot com
 Summary:            PDO_Firebird returns only NULLs for results with
                     boolean for FIREBIRD >= 3.0
 Status:             Open
 Type:               Bug
 Package:            PDO Firebird
 Operating System:   All
 PHP Version:        7.0.18
 Block user comment: N
 Private report:     N

 New Comment:

Here is the fix: https://github.com/php/php-src/pull/2522
Testers are welcome!


Previous Comments:
------------------------------------------------------------------------
[2017-04-17 19:14:10] 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>


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74462&edit=1


Thread (3 messages)

« previous php.bugs (#209096) next »