summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorEric Lemanissier <eric.lemanissier@gmail.com>2015-01-16 11:44:59 +0100
committerMark Brand <mabrand@mabrand.nl>2015-01-16 13:14:26 +0100
commitc28718b88b0cfc712a5177f04475813045c45119 (patch)
tree91b3c06b7f09b746219e7d6ca0fec61f61a826f9 /src/sql
parente01c8103e14371dab7660343aff058528a11d763 (diff)
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 <mabrand@mabrand.nl>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/kernel/qsqlquery.cpp1
1 files changed, 1 insertions, 0 deletions
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);
}