From:             [EMAIL PROTECTED]
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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to