#28204 [Com]: Problem with BIT field type with MSSQL (freetds 0.62.3)

From: Date: Tue, 27 Jul 2004 21:11:52 +0000
Subject: #28204 [Com]: Problem with BIT field type with MSSQL (freetds 0.62.3)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63647@lists.php.net to get a copy of this message
ID: 28204 Comment by: fred at tc dot df dot gov dot br Reported By: johann at infomaniak dot ch Status: Assigned Bug Type: Sybase (dblib) related Operating System: Linux PHP Version: 4.3.6 Assigned To: fmk New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2004-04-28 14:01:12] 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 " ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28204&edit=1

« previous php.bugs (#63647) next »