#43043 [Opn]: NULL == '' for ntext and nvarchar(max)
| From: | alan dot trick at twu dot ca | Date: | Fri, 19 Oct 2007 21:59:11 +0000 |
| Subject: | #43043 [Opn]: NULL == '' for ntext and nvarchar(max) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118739@lists.php.net to get a copy of this message | ||
ID: 43043
User updated by: alan dot trick at twu dot ca
Reported By: alan dot trick at twu dot ca
Status: Open
Bug Type: MSSQL related
Operating System: Linux
PHP Version: 5.2.4
New Comment:
Why would that have anything do do with anything? Aren't those just
limits on the maximum amount of text that can come through?
My values in php.ini are:
mssql.textlimit = 20971520
mssql.textsize = 20971520
I had to set it because mssql was cropping some of my long text fields.
Previous Comments:
------------------------------------------------------------------------
[2007-10-19 21:47:11] felipensp at gmail dot com
This isn't a bug.
Check the configuration options mssql.textlimit and mssql.textsize.
------------------------------------------------------------------------
[2007-10-19 18:51:47] alan dot trick at twu dot ca
Description:
------------
This bug is somewhat related to #39213 except it only occurs (as far as
I can tell) on fields that are ntext and nvarchar(max). The Moodle bug
report MDL-11810 (http://tracker.moodle.org/browse/MDL-11810) has more
info. This is with freeTDS.
Reproduce code:
---------------
$tables = array(
'nulltest' => 'varchar(5)',
'nulltestnvar' => 'nvarchar(5)',
'nulltestntext' => 'ntext',
'nulltestnvarmax' => 'nvarchar(max)'
);
foreach($tables as $table=>$domain) {
print "==$table==\n";
mssql_query("create table $table (test $domain);");
mssql_query("insert into $table values('');");
$r = mssql_query("select * from $table;");
while ($a = mssql_fetch_assoc($r)) var_dump($a['test']);
mssql_query("drop table $table;");
}
Expected result:
----------------
==nulltest==
string(0) ""
==nulltestnvar==
string(0) ""
==nulltestntext==
string(0) ""
==nulltestnvarmax==
string(0) ""
Actual result:
--------------
==nulltest==
string(0) ""
==nulltestnvar==
string(0) ""
==nulltestntext==
NULL
==nulltestnvarmax==
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43043&edit=1