Commit 8b396632 by Konstantin Käfer

Merge commit 'a60ff493' into 2.1

parents 0d4c1346 a60ff493
...@@ -141,6 +141,8 @@ const char* sqlite_code_string(int code); ...@@ -141,6 +141,8 @@ const char* sqlite_code_string(int code);
Statement* stmt = baton->stmt; Statement* stmt = baton->stmt;
#define STATEMENT_END() \ #define STATEMENT_END() \
assert(stmt->locked); \
assert(stmt->db->pending) \
stmt->locked = false; \ stmt->locked = false; \
stmt->db->pending--; \ stmt->db->pending--; \
stmt->Process(); \ stmt->Process(); \
......
...@@ -64,6 +64,8 @@ void Statement::Schedule(EIO_Callback callback, Baton* baton) { ...@@ -64,6 +64,8 @@ void Statement::Schedule(EIO_Callback callback, Baton* baton) {
template <class T> void Statement::Error(T* baton) { template <class T> void Statement::Error(T* baton) {
Statement* stmt = baton->stmt; Statement* stmt = baton->stmt;
// Fail hard on logic errors.
assert(stmt->status != 0);
EXCEPTION(String::New(stmt->message.c_str()), stmt->status, exception); EXCEPTION(String::New(stmt->message.c_str()), stmt->status, exception);
if (!baton->callback.IsEmpty() && baton->callback->IsFunction()) { if (!baton->callback.IsEmpty() && baton->callback->IsFunction()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment