From:             jim dot hatfield at insignia dot com
Operating system: FreeBSD 4.5-RELEASE
PHP version:      4.3.4
PHP Bug Type:     Sybase (dblib) related
Bug description:  queried bit fields are space-padded

Description:
------------
Retrieve one row from a Sybase database using
DB-Lib and Freetds 0.61_1.

"manager" is a smallint and "ts_admin" is a "bit".
The first record has field values 1 and 0 for these
fields respectively.

I did a "portupgrade lang/php4" between the two runs so I know the only
thing which changed was the PHP version.


Reproduce code:
---------------
$db = sybase_connect($server, $user, $pass);
sybase_select_db($dbname, $db);
res = 
$sybase_query("select manager, ts_admin from employees", $db)
$row = sybase_fetch_row($res);

echo "Manager  = \"$row[0]\"\n";
echo "TS_Admin = \"$row[1]\"\n";

Expected result:
----------------
4.3.3 returns:
Manager  = "1"
TS_Admin = "0"

Actual result:
--------------
4.3.4 returns:
Manager  = "1"
TS_Admin = "0                    "

note the space padding. When tested in 
an if this returns TRUE when without the
padding it is FALSE

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

Reply via email to