php.net |  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
Votes:7
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johann at infomaniak dot ch
New email:
PHP Version: OS:

 

 [2004-04-28 14:01 UTC] johann at infomaniak dot ch
Description:
------------
The return value is the real value + a lot of space 
character (it is converted to a string with a constant 
length) 
 
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.patched/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; 
            break; 
         case SYBCHAR: 
 

Expected result:
----------------
an integer 
for example 0 

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

Patches

Pull Requests

History

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Feb 08 20:01:29 2025 UTC