Fossil SCM
Added empty_Stmt, analog to empty_Blob, to work around an assertion triggered during some error handling code.
Commit
4db6d7c5cee08a36f400ae5217efee04b75074f9
Parent
a9070a49445b788…
1 file changed
+8
M
src/db.c
+8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -48,11 +48,19 @@ | ||
| 48 | 48 | Blob sql; /* The SQL for this statement */ |
| 49 | 49 | sqlite3_stmt *pStmt; /* The results of sqlite3_prepare() */ |
| 50 | 50 | Stmt *pNext, *pPrev; /* List of all unfinalized statements */ |
| 51 | 51 | int nStep; /* Number of sqlite3_step() calls */ |
| 52 | 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} | |
| 53 | 60 | #endif /* INTERFACE */ |
| 61 | +const struct Stmt empty_Stmt = empty_Stmt_m; | |
| 54 | 62 | |
| 55 | 63 | /* |
| 56 | 64 | ** Call this routine when a database error occurs. |
| 57 | 65 | */ |
| 58 | 66 | static void db_err(const char *zFormat, ...){ |
| 59 | 67 |
| --- 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 |