From c28718b88b0cfc712a5177f04475813045c45119 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 16 Jan 2015 11:44:59 +0100 Subject: Correction on bound values in case of repeated QSqlQuery::execBatch Until now, QSqlQuery::execBatch did not call resetBindCount, which lead the next call to QSqlQuery::addBindValue to start at non zero index. This is problematic in case of a prepared query which is called several times. Task-number: QTBUG-43874 Change-Id: I1a0f46e39b74d9538009967fd98a269e05aac6f2 Reviewed-by: Mark Brand --- src/sql/kernel/qsqlquery.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sql/kernel/qsqlquery.cpp') diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index 98e262a7e2..2808587d96 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -1060,6 +1060,7 @@ bool QSqlQuery::exec() */ bool QSqlQuery::execBatch(BatchExecutionMode mode) { + d->sqlResult->resetBindCount(); return d->sqlResult->execBatch(mode == ValuesAsColumns); } -- cgit v1.2.3