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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.6, 2.0.18
    • Fix Version/s: 3.0.7, 2.0.19
    • Component/s: General
    • Labels:
      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

            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