Bug #54169 [Com]: Garbage Pointers returned for (n)varchar(max) columns (SQL Server)

From: Date: Thu, 07 Apr 2016 03:44:10 +0000
Subject: Bug #54169 [Com]: Garbage Pointers returned for (n)varchar(max) columns (SQL Server)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200391@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54169&edit=1 ID: 54169 Comment by: jlongo at kastle dot com Reported by: auroraeosrose@php.net Summary: Garbage Pointers returned for (n)varchar(max) columns (SQL Server) Status: Assigned Type: Bug Package: PDO ODBC Operating System: Any PHP Version: Irrelevant Assigned To: auroraeosrose Block user comment: N Private report: N New Comment: no issues with the patch. Apparently PHP is happy to keep security vulnerabilities in multiple versions of their code base for years on end after a patch is submitted. someone who is an official php developer is gonna have to kick this. we have pulled the patch in and have applied it to our builds of PHP that we use with no issue except that it requires extra effort to do a custom patch and compile of source. Previous Comments: ------------------------------------------------------------------------ [2016-04-07 02:49:32] calioptrix at gmail dot com I just spent three hours chasing down this bug. I'm using php 5.6.0 with sql server 2014. Does the proposed patch have issues? As a band-aid, I got around the issue by casting to a varchar of length 8000, the maximum length of a "regular" varchar. In this particular case, truncating the field won't be an issue. SELECT CAST(ColumnName AS VARCHAR(8000)) AS ColumnFixed FROM Table ------------------------------------------------------------------------ [2015-12-30 16:53:48] robshelby at icloud dot com It would be great if this was merged into PHP 5.6 as well. ------------------------------------------------------------------------ [2015-12-17 20:15:33] deankearney at gmail dot com This bug still exists in php7. The fix works. Can we get this merged in? ------------------------------------------------------------------------ [2015-06-05 17:56:20] cmb@php.net Related To: Bug #44278 ------------------------------------------------------------------------ [2015-05-27 00:05:07] jlongo at kastle dot com @trapper - it isn't necessarily a "problem" in ODBC... it is a change in behavior for Microsoft's ODBC Driver 11 implementation. As of ODBC Driver 11, they are returning the length as 0 for max fields. They used to return a very large number for the column size, such as 2147483647 when running on a 32 bit platform, when using varchar(max) fields in prior versions of their driver. As an effect, the pure odbc extension will also need this kind of update to work with Microsoft's ODBC Driver 11 and max fields. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=54169 -- Edit this bug report at https://bugs.php.net/bug.php?id=54169&edit=1

« previous php.bugs (#200391) next »