Bug #67437 [Opn]: error processing nvarchar(max) types from SQL Server with MS ODBC Linux Driver
Edit report at https://bugs.php.net/bug.php?id=67437&edit=1
ID: 67437
Updated by: ab@php.net
Reported by: laurent dot mirguet at aufeminin dot com
Summary: error processing nvarchar(max) types from SQL Server
with MS ODBC Linux Driver
Status: Open
Type: Bug
Package: ODBC related
Operating System: Linux
PHP Version: 5.5.13
Block user comment: N
Private report: N
New Comment:
@laurent, please check the current 5.5+ tree.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2015-02-03 16:26:41] giodev at panozzo dot it
Related To: Bug #68964
------------------------------------------------------------------------
[2014-10-13 09:19:39] stefan dot thuering at gmail dot com
I have a similar problem on Windows 2008 Server.
Running odbc_exec on a nvarchar(max) col in MSSQL crashes PHP 5.5
This was working on PHP 5.4
Error message:
-------------------------
PHP Fatal error: Out of memory (allocated 786432) (tried to allocate 4294967293 bytes) in
....dbFunction.inc.php on line 27
-------------------------
When the field is nvarchar(4000) everything works.
http://stackoverflow.com/questions/17703180/php-odbc-error-tried-to-allocate-4294967293-bytes
------------------------------------------------------------------------
[2014-06-13 10:44:51] laurent dot mirguet at aufeminin dot com
Description:
------------
When using the Microsoft ODBC driver for SQL Server on Linux (see http://msdn.microsoft.com/en-us/library/hh568451%28v=sql.110%29.aspx)
Calling odbc_result() on an nvarchar(max) type results in a memory exhausted error as PHP is trying
to allocate 4Go of RAM (the max size of an nvarchar type).
This seems to happen in the file ext/odbc/php_odbc.c line 2148 :
- the type nvarchar(max) is not recognized in the code, so the switch falls back in the default case
- and the value of result->values[field_ind].vallen is 4Go
I don't know whether the problem comes from the PHP code, the unixODBC code, or the Microsoft
code...
Test script:
---------------
Any odbc_result() call on a non-empty nvarchar(max) type should do the trick and generate a memory
exhauted error.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67437&edit=1
Thread (6 messages)