mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
fix for SF 1871946 (no exception thrown on error)
This commit is contained in:
@@ -81,7 +81,7 @@ void SQLiteStatementImpl::compileImpl()
|
||||
|
||||
while (rc == SQLITE_OK && !pStmt && !queryFound)
|
||||
{
|
||||
rc = sqlite3_prepare(_pDB, pSql, -1, &pStmt, &pLeftover);
|
||||
rc = sqlite3_prepare_v2(_pDB, pSql, -1, &pStmt, &pLeftover);
|
||||
if (rc != SQLITE_OK)
|
||||
{
|
||||
if (pStmt)
|
||||
@@ -145,8 +145,13 @@ void SQLiteStatementImpl::bindImpl()
|
||||
|
||||
// bind
|
||||
Bindings& binds = bindings();
|
||||
if (binds.empty()) return;
|
||||
|
||||
int pc = sqlite3_bind_parameter_count(_pStmt);
|
||||
if (binds.empty() && 0 == pc) return;
|
||||
else if (binds.empty() && pc > 0)
|
||||
throw ParameterCountMismatchException();
|
||||
else if (!binds.empty() && binds.size() * (*binds.begin())->numOfColumnsHandled() != pc)
|
||||
throw ParameterCountMismatchException();
|
||||
|
||||
std::size_t pos = 1; // sqlite starts with 1 not 0!
|
||||
|
||||
Bindings::iterator it = binds.begin();
|
||||
|
||||
Reference in New Issue
Block a user