Bug #14803: Call to SQLGetInfo in odbc_cursor gives empty cursor name
| From: | steven dot gould at stevengould dot org | Date: | Wed, 02 Jan 2002 17:18:10 +0000 |
| Subject: | Bug #14803: Call to SQLGetInfo in odbc_cursor gives empty cursor name | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-75610@lists.php.net to get a copy of this message | ||
From: steven.gould@stevengould.org
Operating system: Sybase ODBC (QNX and Win2k)
PHP version: 4.1.1
PHP Bug Type: ODBC related
Bug description: Call to SQLGetInfo in odbc_cursor gives empty cursor name
This bug appears to have been in the code for several versions - definitely
4.0.5 through 4.1.1. In the odbc_cursor function (defined in
ext/odbc/php_odbc.c), the call to SQLGetInfo (lines 1057-1058 in version
4.1.1 source code) uses a zero as the fourth parameter. This causes
odbc_cursor to incorrectly return an empty cursor name, '' (when using
different versions of Sybase SQL Anywhere under both QNX and Windows
2000).
The "bug" looks like it is more in the Sybase implementation of the ODBC
SQLGetInfo documentation. According to the ODBC documentation, the fourth
parameter is supposed to be ignored when the second parameter is set to an
int type such as SQL_MAX_CURSOR_NAME_LEN.
The fix/workaround is to change the fourth parameter to:
sizeof(max_len)
Can this fix be implemented in the base PHP code so that it works with the
widest selection of ODBC drivers? Correct implementations should ignore
this value. Thanks.
--
Edit bug report at: http://bugs.php.net/?id=14803&edit=1