From:             johann at infomaniak dot ch
Operating system: Linux
PHP version:      4.3.6
PHP Bug Type:     Sybase (dblib) related
Bug description:  Problem with BIT field type with MSSQL (freetds 0.62.3)

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                  " 

-- 
Edit bug report at http://bugs.php.net/?id=28204&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28204&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28204&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28204&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28204&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28204&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28204&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28204&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28204&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28204&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28204&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28204&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28204&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28204&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28204&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28204&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28204&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28204&r=float

Reply via email to