summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/sqlite
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-05-15 22:15:04 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-05-16 11:42:25 +0000
commitb0f3cc1594308ed3f3977bdcd451e8cf0eb0478d (patch)
tree9a0a0b820aefbddb0ea28b6cb0bbe821834fad9d /src/plugins/sqldrivers/sqlite
parent9c707f140e96937f2ea256a6a93dc827328f22ad (diff)
sqlite: Allow for duplicated placeholders with just one placeholder
This accounts for a case of a placeholder being duplicated in the prepare query, but where only one placeholder was used. This amends e4e87a2ece1e0c9901514fea094f31863b64b570 Task-number: QTBUG-68299 Change-Id: Ia92ee912facd51a13e7222886debb219b24442b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/sqlite')
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index a862e8d2a7..2a770d0245 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -496,10 +496,10 @@ bool QSQLiteResult::exec()
#if (SQLITE_VERSION_NUMBER >= 3003011)
// In the case of the reuse of a named placeholder
- // We need to check explicitly that paramCount is greater than 1, as sqlite
+ // We need to check explicitly that paramCount is greater than or equal to 1, as sqlite
// can end up in a case where for virtual tables it returns 0 even though it
// has parameters
- if (paramCount > 1 && paramCount < values.count()) {
+ if (paramCount >= 1 && paramCount < values.count()) {
const auto countIndexes = [](int counter, const QVector<int> &indexList) {
return counter + indexList.length();
};