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

Connector reports incorrect number of affected rows for statements in batch

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.6, 2.0.18
    • 3.0.7, 2.0.19
    • General
    • None

    Description

      For 2nd statement generating affected rows number, SQLRowCount would still return the row count for 1st statement. To repeat

      ODBC_TEST(test_multi_statements)

      { SQLLEN num_inserted; SQLRETURN rc; OK_SIMPLE_STMT(Stmt, "DROP TABLE IF EXISTS t1"); OK_SIMPLE_STMT(Stmt, "CREATE TABLE t1 (a int)"); OK_SIMPLE_STMT(Stmt, "INSERT INTO t1 VALUES(1);INSERT INTO t1 VALUES(2), (3)"); SQLRowCount(Stmt, &num_inserted); diag("inserted: %ld", (long)num_inserted); FAIL_IF(num_inserted != 1, "Expected 1 row inserted"); rc= SQLMoreResults(Stmt); num_inserted= 0; rc= SQLRowCount(Stmt, &num_inserted); FAIL_IF(num_inserted != 2, "Expected 2 row inserted"); rc= SQLMoreResults(Stmt); FAIL_IF(rc != SQL_NO_DATA, "expected no more results"); return OK; }

      2nd call of SQLRowCount returns 1

      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.