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

Column count stays from previous query for queries not returning resultset

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.0.10
    • 2.0.11
    • None
    • None

    Description

      If after SELECT(or catalog function, or SQLGetTypeInfo), application runs smth like UPSERT, and then examines SQLNumResultCols, it will return number of columns in previous resultset. This is what issue#4 from github boils down to.

      The testcase:

      ODBC_TEST(t_odbc41)

      { SQLSMALLINT cols_count; OK_SIMPLE_STMT(Stmt, "drop table if exists t_odbc41"); OK_SIMPLE_STMT(Stmt, "SELECT 1, 2, 3, 4"); CHECK_STMT_RC(Stmt, SQLFetch(Stmt)); CHECK_STMT_RC(Stmt, SQLNumResultCols(Stmt, &cols_count)); is_num(cols_count, 4); CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE)); OK_SIMPLE_STMT(Stmt, "CREATE TABLE t_odbc41 (id INT PRIMARY KEY auto_increment)"); CHECK_STMT_RC(Stmt, SQLNumResultCols(Stmt, &cols_count)); is_num(cols_count, 0); OK_SIMPLE_STMT(Stmt, "drop table if exists t_odbc41"); return OK; }

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            Lawrin Lawrin Novitsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.