summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-12-07 16:01:48 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-01-02 06:32:16 +0000
commit52b85212a2ec8ec5bf187f6cd00b669a45bcf0bd (patch)
treecbf15416a504b005bb38627e0af7d043b41e8c9c
parentdb92f2f3aac60218756a1aa8811cf192acc0b0e6 (diff)
sqlite: Check that there are values to be set when binding
If the values vector is empty then we know already that the paramCount will still be invalid, so we should just accept that and not check the reused named placeholders. Task-number: QTBUG-64923 Change-Id: Ifaa755540c4574f1f76d3f9f129bf0f66b837b70 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index e9f5ee9508..67dd1a6ee5 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -467,7 +467,7 @@ bool QSQLiteResult::exec()
#if (SQLITE_VERSION_NUMBER >= 3003011)
// In the case of the reuse of a named placeholder
- if (!paramCountIsValid) {
+ if (paramCount < values.count()) {
const auto countIndexes = [](int counter, const QList<int>& indexList) {
return counter + indexList.length();
};