From 52b85212a2ec8ec5bf187f6cd00b669a45bcf0bd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 7 Dec 2017 16:01:48 +0100 Subject: 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 --- src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp') 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& indexList) { return counter + indexList.length(); }; -- cgit v1.2.3