Fossil SCM
Added g.interp cleanup to db_close() to allow th1 to clean up any statement handles it creates.
Commit
008a16c0e5980626793bc1ceed2f6eea37786aa5
Parent
eb4a373ee8144ae…
1 file changed
+6
M
src/db.c
+6
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1098,10 +1098,16 @@ | ||
| 1098 | 1098 | ** argument is true. Ignore unfinalized statements when false. |
| 1099 | 1099 | */ |
| 1100 | 1100 | void db_close(int reportErrors){ |
| 1101 | 1101 | sqlite3_stmt *pStmt; |
| 1102 | 1102 | if( g.db==0 ) return; |
| 1103 | + if(g.interp){ | |
| 1104 | + /* clean up up any query_prepare statements */ | |
| 1105 | + Th_DeleteInterp(g.interp); | |
| 1106 | + g.interp = 0; | |
| 1107 | + } | |
| 1108 | + | |
| 1103 | 1109 | if( g.fSqlStats ){ |
| 1104 | 1110 | int cur, hiwtr; |
| 1105 | 1111 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &hiwtr, 0); |
| 1106 | 1112 | fprintf(stderr, "-- LOOKASIDE_USED %10d %10d\n", cur, hiwtr); |
| 1107 | 1113 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &cur, &hiwtr, 0); |
| 1108 | 1114 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1098,10 +1098,16 @@ | |
| 1098 | ** argument is true. Ignore unfinalized statements when false. |
| 1099 | */ |
| 1100 | void db_close(int reportErrors){ |
| 1101 | sqlite3_stmt *pStmt; |
| 1102 | if( g.db==0 ) return; |
| 1103 | if( g.fSqlStats ){ |
| 1104 | int cur, hiwtr; |
| 1105 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &hiwtr, 0); |
| 1106 | fprintf(stderr, "-- LOOKASIDE_USED %10d %10d\n", cur, hiwtr); |
| 1107 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &cur, &hiwtr, 0); |
| 1108 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1098,10 +1098,16 @@ | |
| 1098 | ** argument is true. Ignore unfinalized statements when false. |
| 1099 | */ |
| 1100 | void db_close(int reportErrors){ |
| 1101 | sqlite3_stmt *pStmt; |
| 1102 | if( g.db==0 ) return; |
| 1103 | if(g.interp){ |
| 1104 | /* clean up up any query_prepare statements */ |
| 1105 | Th_DeleteInterp(g.interp); |
| 1106 | g.interp = 0; |
| 1107 | } |
| 1108 | |
| 1109 | if( g.fSqlStats ){ |
| 1110 | int cur, hiwtr; |
| 1111 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &hiwtr, 0); |
| 1112 | fprintf(stderr, "-- LOOKASIDE_USED %10d %10d\n", cur, hiwtr); |
| 1113 | sqlite3_db_status(g.db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &cur, &hiwtr, 0); |
| 1114 |