see CHANGELOG

- upgraded SQLite to version 3.7.15.1 (2012-12-19)
- fixed SQLite affectedRows reporting and added tests
- added SQLite::Utility::isThreadSafe() function
- added SQLite::Utility::setThreadMode(int mode) function
- fixed GH #41: Buffer::resize crash
This commit is contained in:
aleks-f
2012-12-23 02:36:01 -06:00
parent 16533ef73b
commit 760fa4bbb0
12 changed files with 3969 additions and 2723 deletions

View File

@@ -215,14 +215,15 @@ void SQLiteStatementImpl::bindImpl()
else if (bindCount > remainingBindCount)
throw ParameterCountMismatchException();
std::size_t boundRowCount;
if (_bindBegin != bindings().end())
{
_affectedRowCount = (*_bindBegin)->numOfRowsHandled();
boundRowCount = (*_bindBegin)->numOfRowsHandled();
Bindings::iterator oldBegin = _bindBegin;
for (std::size_t pos = 1; _bindBegin != bindEnd && (*_bindBegin)->canBind(); ++_bindBegin)
{
if (_affectedRowCount != (*_bindBegin)->numOfRowsHandled())
if (boundRowCount != (*_bindBegin)->numOfRowsHandled())
throw BindingException("Size mismatch in Bindings. All Bindings MUST have the same size");
(*_bindBegin)->bind(pos);
@@ -270,6 +271,9 @@ bool SQLiteStatementImpl::hasNext()
_stepCalled = true;
_nextResponse = sqlite3_step(_pStmt);
if (_affectedRowCount == POCO_SQLITE_INV_ROW_CNT) _affectedRowCount = 0;
_affectedRowCount += sqlite3_changes(_pDB);
if (_nextResponse != SQLITE_ROW && _nextResponse != SQLITE_OK && _nextResponse != SQLITE_DONE)
Utility::throwException(_nextResponse);
@@ -296,6 +300,8 @@ std::size_t SQLiteStatementImpl::next()
_isExtracted = true;
}
_stepCalled = false;
if (_affectedRowCount == POCO_SQLITE_INV_ROW_CNT) _affectedRowCount = 0;
_affectedRowCount += (*extracts.begin())->numOfRowsHandled();
}
else if (SQLITE_DONE == _nextResponse)
{
@@ -303,8 +309,7 @@ std::size_t SQLiteStatementImpl::next()
}
else
{
int rc = _nextResponse;
Utility::throwException(rc, std::string("Iterator Error: trying to access the next value"));
Utility::throwException(_nextResponse, std::string("Iterator Error: trying to access the next value"));
}
return 1u;