#26835 [NEW]: wrong data type returned by mssql_fetch_array

From: Date: Thu, 08 Jan 2004 03:17:35 +0000
Subject: #26835 [NEW]: wrong data type returned by mssql_fetch_array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52967@lists.php.net to get a copy of this message
From:             skissane at ics dot mq dot edu dot au
Operating system: Solaris 2.6
PHP version:      4.3.4
PHP Bug Type:     MSSQL related
Bug description:  wrong data type returned by mssql_fetch_array

Description:
------------
The following script returns an empty string on Solaris, when it should
return a NULL (which it does, correctly, on Linux.)

This is using FreeTDS 0.61.2 (same problem occurs with FreeTDS 0.52).

This is talking to a SQL Server 2000 using TDS version 7.0 (switching to
8.0 made no difference).

I've checked, and:
mssql.compatability_mode = Off
in php.ini.

Reproduce code:
---------------
<?
$id =
mssql_connect("<servername>","<username>","<password>");
$q = mssql_query("SELECT NULL",$id);
$f = mssql_fetch_array($q);
echo gettype($f[0]);

Expected result:
----------------
NULL

Actual result:
--------------
string

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


Thread (3 messages)

« previous php.bugs (#52967) next »