php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44835 DBLIB driver - Weird NULL behavior
Submitted: 2008-04-25 19:08 UTC Modified: 2008-10-29 01:00 UTC
Votes:6
Avg. Score:4.8 ± 0.4
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:2 (33.3%)
From: alexandre at gaigalas dot net Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.5 OS: SuSE Enterprise
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alexandre at gaigalas dot net
New email:
PHP Version: OS:

 

 [2008-04-25 19:08 UTC] 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 )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-21 11:30 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-10-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2014-03-20 18:15 UTC] contact at nicolasbouliane dot com
I am having the same issue with SQL Server 2008, dblib and PHP 5.3.19
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC