(Please forgive me if this is not the right forum for this question.  This isn't
exactly a bug so I didn't feel it was right to open a bug report.)

I have a question about a change that was made to ext/sybase/php_sybase_db.c between
PHP versions 4.3.3 and 4.3.4.  I'm referring specifically to revision 1.38.2.14.
Here's the diff:

http://makeashorterlink.com/?L14025838

I've been using PHP + FreeTDS + the sybase extension for the past 2 years to access
a MS-SQL version 7 server without issue.  After the above change I'm running into an
odd problem with bit fields.  I frequently do boolean checks on bit fields in my
code, like so:

$row = $db->fetch_object($result);

if ($row->bitField) {
  ...
} else {
  ...
}

It seems that all this time FreeTDS is returning a bit field that contains '0' in
the database with about 20 additional spaces padded on the right side.  All this
time I was not aware of it because the code in the sybase extension was trimming it
for me, but with the change mentioned above it is no longer doing so, and my boolean
checks are all returning true, since they are checking "0     " instead of just "0".

I suppose this may be a bug with FreeTDS, or something else, but I was just curious
as to why this whitespace stripping was there in the first place, and why it was
removed (the commit log just says "MFH: Do not strip trailing spaces").  I was
hoping someone here could point me in the right direction before I started ripping
everything apart to see where this whitespace is being introduced.

Thanks in advance...

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to