From 629d2f12bab8c68d3f13313113dfb213171ea36f Mon Sep 17 00:00:00 2001 From: FrancisANDRE Date: Tue, 17 Nov 2015 21:12:23 +0100 Subject: [PATCH] When we call statement execution for "PRAGMA incremental_vacuum(1024);" it fails with null std iterator exception. It happens because variable "extracts" is empty and construction "*extracts.begin()" is invalid. Signed-off-by: FrancisANDRE --- Data/SQLite/src/SQLiteStatementImpl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Data/SQLite/src/SQLiteStatementImpl.cpp b/Data/SQLite/src/SQLiteStatementImpl.cpp index 5f0b6c725..9910b20cb 100644 --- a/Data/SQLite/src/SQLiteStatementImpl.cpp +++ b/Data/SQLite/src/SQLiteStatementImpl.cpp @@ -274,6 +274,9 @@ std::size_t SQLiteStatementImpl::next() _stepCalled = false; if (_affectedRowCount == POCO_SQLITE_INV_ROW_CNT) _affectedRowCount = 0; + if (extracts.size()) + + //_affectedRowCount += (*extracts.begin())->numOfRowsHandled(); if (extracts.size()) _affectedRowCount += (*extracts.begin())->numOfRowsHandled(); else @@ -281,6 +284,11 @@ std::size_t SQLiteStatementImpl::next() _stepCalled = true; _nextResponse = SQLITE_DONE; } + else + { + _stepCalled = true; + _nextResponse = SQLITE_DONE; + } } else if (SQLITE_DONE == _nextResponse)