#15265 [Opn->Fbk]: printing of mssql 'bit' value crashes script
| From: | iliaa@php.net | Date: | Wed, 09 Oct 2002 16:47:34 +0000 |
| Subject: | #15265 [Opn->Fbk]: printing of mssql 'bit' value crashes script | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-21948@lists.php.net to get a copy of this message | ||
ID: 15265
Updated by: iliaa@php.net
Reported By: shawn@wnsi.net
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Linux 2.4.2-2smp Redhat7.1
PHP Version: 4.1.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-01-28 20:15:22] shawn@wnsi.net
outputing a bit field via print, echo, or var_dump causes the process
to go defunct.
--setup info
Apache/1.3.14 Ben-SSL/1.42
php 4.1.1
./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml
--enable-ftp --with-sybase=/usr/local/freetds
--with-openssl=/usr/local/ssl --with-curl
freetds-0.51
mssql server 7.0
Here is an example
-------------------------------------------
$bit_result = mssql_query('SELECT some_bit_field FROM fake_table');
$bit_row = mssql_fetch_array($bit_result);
print $bit_row['some_bit_field'];
-------------------------------------------
--script crashes and the apache process goes defunct
-------------------------------------------
This SQL cast fixes it....
-------------------------------------------
$bit_result = mssql_query('SELECT Cast(some_bit_field AS varchar(2)) AS
some_bit_field FROM fake_table');
$bit_row = mssql_fetch_array($bit_result);
print $bit_row['some_bit_field'];
-------------------------------------------
-------------------------------------------
The actual script that led me to discover this problem was sigificantly
longer and I was able to use the value as long as I never ouput it (I
think the reslts of comparisons I made were false though. i.e. if (
$bit_row['some_bit_field'] == 1 ) {} ). The point is that you can
include the value in the expression but never ouput it.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15265&edit=1