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

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

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

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration