ID: 29383 User updated by: gunther at ultraconsulting dot com Reported By: gunther at ultraconsulting dot com Status: Bogus Bug Type: MSSQL related Operating System: Windows 2000 PHP Version: 4.3.7, 5.0.0 New Comment:
Thx! That last statement sounds familiar but doesn't help to fix the problem. It also does not explain why the older PHP version is handling it correct. Isn't there a way to get a workaround like mcknight found. I froze the current installation and cannot upgrade ... might try mcknight contribution. Previous Comments: ------------------------------------------------------------------------ [2006-05-04 19:44:08] [EMAIL PROTECTED] The bug is in ntwdblib.dll, please complain to Microsoft. ------------------------------------------------------------------------ [2006-05-04 19:32:56] bhiggins at gmail dot com We are experiencing this bug with PHP 5.1.2 and sybase-ct. I can't believe this has gone unfixed for so long. ------------------------------------------------------------------------ [2005-09-06 16:52:16] mcknight at chek dot com Since it seems that no one wants to work on this we made the changes we needed to the source and recreated the dll. If you are having the same problem you can either build a new php_mssql.dll or email me for a copy of ours. ------------------------------------------------------------------------ [2005-08-02 00:12:09] mcknightj at lovullo dot com To answer the question from 13 Dec 2004, the current snapshot links are displaying the same problem. Also the bug is currently listed as 'No feedback', is there a way to roll it back to open again?? Don't want to go through and open a new bug with the same problem. ------------------------------------------------------------------------ [2005-07-28 20:25:37] mcknightj at lovullo dot com Not sure if I missed where this was addressed, but I'm having this problem after upgrading from 4.3.2 to 4.3.11. We're using php on windows 2003 IIS and have reviewed both this bug report and bug #29292 (listed as bogus). Reviewing the problem it looks like an empty column is being returned as a single space value. Null values are being correctly returned but empty varchar fields are not. I have reviewed the data in enterprise manager, php through IIS, ????, and access through ODBC. In all the cases null's are reported as nulls, strings as strings and empty columns as empty columns (except php). This is probably a problem with the windows db library and not php but it would be easier to correct here rather then php code until microsoft updates their library. Here is an example of what results we get. DATA: id | name ============================== 1 | 'my name' 2 | <NULL> 3 | '' PHP: [echo $result['id']." - '".$result['name']."'";] 1 - 'my name' 2 - '' 3 - ' ' The change happened around 4.3.4 with the following change in php_mssql.c: #if ilia_0 while (length>0 && data[length-1] == ' ') { /* nuke trailing whitespace */ length--; } #endif Maybe this could be updated to the following to handle the single space problem with empty strings: if (length == 1 && data[0] == ' ') { /* nuke whitespace from empty string */ length = 0; data = ''; } Please let me know if you need any additional info or let me know if a work around is already present (other then reverting back to 4.3.3). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29383 -- Edit this bug report at http://bugs.php.net/?id=29383&edit=1