#49107 [NEW]: Empty string is returned as NULL, see bug: 39213
| From: | jochem dot blok at fasterforward dot nl | Date: | Thu, 30 Jul 2009 07:53:37 +0000 |
| Subject: | #49107 [NEW]: Empty string is returned as NULL, see bug: 39213 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-140471@lists.php.net to get a copy of this message | ||
From: jochem dot blok at fasterforward dot nl
Operating system: Debian
PHP version: 5.2.10
PHP Bug Type: MSSQL related
Bug description: Empty string is returned as NULL, see bug: 39213
Description:
------------
This is the same bug as reported in bug: 39213. An empty string is
returned as NULL.
Reproduce code:
---------------
$conn = mssql_connect('host','user','password', true);
mssql_query("CREATE TABLE #tmp(c VARCHAR(10) NULL)", $conn) or
die("error querying");
mssql_query("INSERT INTO #tmp VALUES('')", $conn) or die("error
querying");
$res = mssql_query("SELECT * FROM #tmp", $conn) or die("query");
$row = mssql_fetch_assoc($res);
$s = is_null($row['c']) ? 'NULL' : $row['c'];
echo "got -$s-\n";
Expected result:
----------------
var_dump($s) should print string(0) ""
Actual result:
--------------
var_dump($s) print NULL
--
Edit bug report at http://bugs.php.net/?id=49107&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49107&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49107&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49107&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49107&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49107&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49107&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49107&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49107&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49107&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49107&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49107&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49107&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49107&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49107&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49107&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49107&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49107&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49107&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49107&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49107&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49107&r=mysqlcfg