[ODBC-183] Connector reports incorrect number of affected rows for statements in batch Created: 2018-09-13  Updated: 2018-09-13  Resolved: 2018-09-13

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.6, 2.0.18
Fix Version/s: 3.0.7, 2.0.19

Type: Bug Priority: Major
Reporter: Lawrin Novitsky Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
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



 Comments   
Comment by Lawrin Novitsky [ 2018-09-13 ]

The fix and changed existing testcase have been pushed as part of the commit fixing ODBC-169

Generated at Thu Feb 08 03:26:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.