Fossil SCM

Added empty_Stmt, analog to empty_Blob, to work around an assertion triggered during some error handling code.

stephan 2011-10-02 19:56 UTC json-multitag-test
Commit 4db6d7c5cee08a36f400ae5217efee04b75074f9
1 file changed +8
+8
--- src/db.c
+++ src/db.c
@@ -48,11 +48,19 @@
4848
Blob sql; /* The SQL for this statement */
4949
sqlite3_stmt *pStmt; /* The results of sqlite3_prepare() */
5050
Stmt *pNext, *pPrev; /* List of all unfinalized statements */
5151
int nStep; /* Number of sqlite3_step() calls */
5252
};
53
+
54
+/*
55
+** Copy this to initialize a Stmt object to a clean/empty state. This
56
+** is useful to help avoid assertions when performing cleanup in some
57
+** error handling cases.
58
+*/
59
+#define empty_Stmt_m {BLOB_INITIALIZER,NULL, NULL, NULL, 0}
5360
#endif /* INTERFACE */
61
+const struct Stmt empty_Stmt = empty_Stmt_m;
5462
5563
/*
5664
** Call this routine when a database error occurs.
5765
*/
5866
static void db_err(const char *zFormat, ...){
5967
--- src/db.c
+++ src/db.c
@@ -48,11 +48,19 @@
48 Blob sql; /* The SQL for this statement */
49 sqlite3_stmt *pStmt; /* The results of sqlite3_prepare() */
50 Stmt *pNext, *pPrev; /* List of all unfinalized statements */
51 int nStep; /* Number of sqlite3_step() calls */
52 };
 
 
 
 
 
 
 
53 #endif /* INTERFACE */
 
54
55 /*
56 ** Call this routine when a database error occurs.
57 */
58 static void db_err(const char *zFormat, ...){
59
--- src/db.c
+++ src/db.c
@@ -48,11 +48,19 @@
48 Blob sql; /* The SQL for this statement */
49 sqlite3_stmt *pStmt; /* The results of sqlite3_prepare() */
50 Stmt *pNext, *pPrev; /* List of all unfinalized statements */
51 int nStep; /* Number of sqlite3_step() calls */
52 };
53
54 /*
55 ** Copy this to initialize a Stmt object to a clean/empty state. This
56 ** is useful to help avoid assertions when performing cleanup in some
57 ** error handling cases.
58 */
59 #define empty_Stmt_m {BLOB_INITIALIZER,NULL, NULL, NULL, 0}
60 #endif /* INTERFACE */
61 const struct Stmt empty_Stmt = empty_Stmt_m;
62
63 /*
64 ** Call this routine when a database error occurs.
65 */
66 static void db_err(const char *zFormat, ...){
67

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button