Edit report at https://bugs.php.net/bug.php?id=69381&edit=1
ID: 69381
Updated by: ab@php.net
Reported by: JLH at Dataplan dot co dot uk
Summary: out of memory with sage odbc driver (ok in 5.6.5)
-Status: Analyzed
+Status: Closed
Type: Bug
Package: ODBC related
Operating System: Windows 2012r2 nts
PHP Version: 5.6.7
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=268eb1999b1598a2a1a875c5f0172d5b615811ac
Log: fix bug #69381
Previous Comments:
------------------------------------------------------------------------
[2015-04-27 14:45:23] ab@php.net
@cmb, ah ... that's SQLColAttribute, not SQLColAttributes - as we've ODBC 3.0 by default.
Thanks.
------------------------------------------------------------------------
[2015-04-27 14:43:39] ab@php.net
@JLH thanks for the delivery, I can now confirm the insights of @cmb.
The Sage driver claims compatibility with ODBC 3.8, however this piece seems to be a bug in that
driver. SQL_DESC_OCTET_LENGTH is introduced with ODBC 3.0, so it should be supported. @JLH it might
probably make sense to report this to the origin.
I'm going to debug this more next days, seems that other drivers having unclean 3.x
implementations may be sensitive to this as well. In the worst case I guess we'll need to apply
the quirk from the bug #68350.
Thanks.
------------------------------------------------------------------------
[2015-04-26 18:25:19] cmb@php.net
The ODBC trace[1] explains what's happening. The SQLColAttributes
call for SQL_DESC_CONCISE_TYPE[2] returns SQL_VARCHAR. That causes
SQLColAttributes to be called with SQL_DESC_OCTET_LENGTH[3] to get
the displaysize, but the driver can't handle that attribute.
However, the SQL_ERROR is not caught, and the implementation
proceeds with emalloc'ing whatever is stored in displaysize.
For comparison, see the ODBC trace[4] under PHP 5.6.5.
This issue is closely related to bug #68350.
Anatol, can you please have a look.
[1] <https://gist.github.com/cmb69/e34ce51bfc50f6a8c8d6>
[2] <http://lxr.php.net/xref/PHP_TRUNK/ext/odbc/php_odbc.c#959>
[3] <http://lxr.php.net/xref/PHP_TRUNK/ext/odbc/php_odbc.c#994>
[4] <https://gist.github.com/cmb69/39662a0973653ddf7880>
------------------------------------------------------------------------
[2015-04-26 04:22:18] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2015-04-23 17:36:30] JLH at Dataplan dot co dot uk
Sorry for the delay
I have put the standard sage demo data, the odbc driver and a readme.txt at
http://109.234.200.229/php69381/
Hope that helps
------------------------------------------------------------------------
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=69381
--
Edit this bug report at https://bugs.php.net/bug.php?id=69381&edit=1