Fix a sqlite3 bug when some SQL errors occur (#252)

This commit is contained in:
An Tao 2019-09-23 08:59:10 +08:00 committed by GitHub
parent db18f565e1
commit b38a01bdea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -152,6 +152,7 @@ void Sqlite3Connection::execSqlInQueue(
if (ret != SQLITE_OK || !stmtPtr)
{
onError(sql, exceptCallback);
_idleCb();
return;
}
if (!std::all_of(remaining, sql.data() + sql.size(), [](char ch) {
@ -169,6 +170,7 @@ void Sqlite3Connection::execSqlInQueue(
auto exceptPtr = std::current_exception();
exceptCallback(exceptPtr);
}
_idleCb();
return;
}
}
@ -214,6 +216,7 @@ void Sqlite3Connection::execSqlInQueue(
{
onError(sql, exceptCallback);
sqlite3_reset(stmt);
_idleCb();
return;
}
}
@ -253,6 +256,7 @@ void Sqlite3Connection::execSqlInQueue(
{
onError(sql, exceptCallback);
sqlite3_reset(stmt);
_idleCb();
return;
}
if (paraNum > 0 && newStmt)