diff options
author | drh <drh@noemail.net> | 2008-01-23 03:03:05 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-01-23 03:03:05 +0000 |
commit | 7e8b848a60a305231cca0b8cfc7f08be5f0429bd (patch) | |
tree | b413adb49b7ddd4166e6a878068fd15e1a25273e /src/vdbeapi.c | |
parent | 4b2f9368cbbc9a26e8dcbcb87791267c10d14f50 (diff) | |
download | sqlite-7e8b848a60a305231cca0b8cfc7f08be5f0429bd.tar.gz sqlite-7e8b848a60a305231cca0b8cfc7f08be5f0429bd.zip |
Make sqlite3SafetyOn() and sqlite3SafetyOff() macros which disappear when
compiling without -DSQLITE_DEBUG=1. (CVS 4744)
FossilOrigin-Name: 5375ad6b4b652f388469b0ce4e8e78b3f49169bd
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 7d44fb158..df9c75f68 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -44,7 +44,9 @@ int sqlite3_finalize(sqlite3_stmt *pStmt){ rc = SQLITE_OK; }else{ Vdbe *v = (Vdbe*)pStmt; +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = v->db->mutex; +#endif sqlite3_mutex_enter(mutex); rc = sqlite3VdbeFinalize(v); sqlite3_mutex_leave(mutex); @@ -81,12 +83,14 @@ int sqlite3_reset(sqlite3_stmt *pStmt){ int sqlite3_clear_bindings(sqlite3_stmt *pStmt){ int i; int rc = SQLITE_OK; - Vdbe *v = (Vdbe*)pStmt; - sqlite3_mutex_enter(v->db->mutex); +#ifndef SQLITE_MUTEX_NOOP + sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex; +#endif + sqlite3_mutex_enter(mutex); for(i=1; rc==SQLITE_OK && i<=sqlite3_bind_parameter_count(pStmt); i++){ rc = sqlite3_bind_null(pStmt, i); } - sqlite3_mutex_leave(v->db->mutex); + sqlite3_mutex_leave(mutex); return rc; } |