|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28204 Problem with BIT field type with MSSQL (freetds 0.62.3)
Submitted: 2004-04-28 14:01 UTC Modified: 2005-04-02 01:00 UTC
Avg. Score:4.7 ± 0.7
Reproduced:6 of 7 (85.7%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: johann at infomaniak dot ch Assigned: fmk (profile)
Status: No Feedback Package: Sybase (dblib) related
PHP Version: 4.3.6 OS: Linux
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.
Block user comment
Status: Assign to:
Bug Type:
From: johann at infomaniak dot ch
New email:
PHP Version: OS:


 [2004-04-28 14:01 UTC] johann at infomaniak dot ch
The return value is the real value + a lot of space 
character (it is converted to a string with a constant 
maybe the problem come from freetds dbconvert. I have this 
problem since php 4.3.4 and in php 4.3.4 I applyed the 
following patch. 
diff -ruP php-4.3.4/ext/sybase/php_sybase_db.c 
--- php-4.3.4/ext/sybase/php_sybase_db.c  2003-10-16 
06:24:04.000000000 +0200 
+++ php-4.3.4.patched/ext/sybase/php_sybase_db.c   
2004-01-29 11:51:41.000000000 +0100 
@@ -680,6 +680,7 @@ 
   switch (column_type) 
+     case SYBBIT: 
      case SYBINT2: 
      case SYBINT4: { 
         Z_LVAL_P(result) = (long) anyintcol(offset); 
@@ -893,6 +894,7 @@ 
         case SYBINT4: 
         case SYBFLT8: 
         case SYBREAL: 
+        case SYBBIT: 
            result->fields[i].numeric = 1; 
         case SYBCHAR: 

Expected result:
an integer 
for example 0 

Actual result:
a string with constant length 
for example 
"0                  " 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-27 23:11 UTC] fred at tc dot df dot gov dot br
this patch doesn't resolve the problem 100%.
this line:

if ($row[Relationship]==1) 

returns false on php>=4.3.4, true on others.

the field Relationship on mssql 6.5 is tinynit
 [2005-04-02 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".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 05:03:34 2021 UTC