34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
|
From cd12671fac459b71d2f5f65d3e221e4e8fca25f1 Mon Sep 17 00:00:00 2001
|
||
|
From: Andy Shaw <andy.shaw@qt.io>
|
||
|
Date: Thu, 7 Dec 2017 16:01:48 +0100
|
||
|
Subject: [PATCH 1/3] 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>
|
||
|
---
|
||
|
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
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();
|
||
|
};
|
||
|
--
|
||
|
2.16.2
|
||
|
|