Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
-
Windows 32/64 bit
Description
When trying to bind a column to a statement which was previously executed via SQLExecDirect, SQLBindCol fails with 07009 - Invalid descriptor index.
According to the MSDN ODBC documentation (see hhttp://msdn.microsoft.com/en-us/library/ms711010%28v=vs.85%29.aspx) an error should be returned only, if the last executed statement produced an result set.
Suggested fix:
ma_statement.c |
if ((ColumnNumber < 1 && Stmt->Options.UseBookmarks == SQL_UB_OFF) ||
|
(mysql_stmt_field_count(Stmt->stmt) &&
|
Stmt->stmt->state > MYSQL_STMT_PREPARED &&
|
ColumnNumber > mysql_stmt_field_count(Stmt->stmt)))
|
{
|
MADB_SetError(&Stmt->Error, MADB_ERR_07009, NULL, 0);
|
return SQL_ERROR;
|
}
|