PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #14803 Call to SQLGetInfo in odbc_cursor gives empty cursor name
Submitted:2 Jan 2002 12:18pm UTC Modified: 30 Jan 2002 4:53pm UTC
From:steven dot gould at stevengould dot org Assigned to:
Status:Closed Category:ODBC related
Version:4.1.1 OS:Sybase ODBC (QNX and Win2k)
Votes:3 Avg. Score:3.7 ± 0.5 Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%) Same OS:0 (0.0%)
View/Vote Developer Edit Submission

[2 Jan 2002 12:18pm UTC] steven dot gould at stevengould dot org
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.
[30 Jan 2002 4:53pm UTC] kalowsky@php.net
as soon as my CVS finishes its connect, this should be done.

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC