#44835 [Opn->Fbk]: DBLIB driver - Weird NULL behavior
ID: 44835
Updated by: jani@php.net
Reported By: alexandre at gaigalas dot net
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: SuSE Enterprise
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-04-25 19:08:34] alexandre at gaigalas dot net
Description:
------------
Fetching data on BIT columns with NULL values return 0 (zero) instead
of NULL.
Reproduce code:
---------------
<?php
$db = new PDO('dblib:host=X;dbname=X', 'x', 'x');
print_r($db->query("SELECT CONVERT(BIT,NULL) AS
THIS_MUST_BE_BLANK")->fetch(PDO::FETCH_ASSOC));
Expected result:
----------------
Array ( [THIS_MUST_BE_BLANK] => )
Actual result:
--------------
Array ( [THIS_MUST_BE_BLANK] => 0 )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44835&edit=1
Thread (3 messages)