Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-3

SQLBindCol fails with error 07009

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      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;
        }

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: