Fossil SCM

Suppress "database locked" warnings on the "PRAGMA optimize" that occurs as the process is shutting down.

drh 2017-04-12 11:26 trunk
Commit 41956e7000813c3c3d26292401471b266b63b2218a41bf79461ae8f76fb2dc52
1 file changed +2
+2
--- src/db.c
+++ src/db.c
@@ -1666,11 +1666,13 @@
16661666
while( db.pAllStmt ){
16671667
db_finalize(db.pAllStmt);
16681668
}
16691669
db_end_transaction(1);
16701670
pStmt = 0;
1671
+ g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
16711672
sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0);
1673
+ g.dbIgnoreErrors--;
16721674
db_close_config();
16731675
16741676
/* If the localdb has a lot of unused free space,
16751677
** then VACUUM it as we shut down.
16761678
*/
16771679
--- src/db.c
+++ src/db.c
@@ -1666,11 +1666,13 @@
1666 while( db.pAllStmt ){
1667 db_finalize(db.pAllStmt);
1668 }
1669 db_end_transaction(1);
1670 pStmt = 0;
 
1671 sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0);
 
1672 db_close_config();
1673
1674 /* If the localdb has a lot of unused free space,
1675 ** then VACUUM it as we shut down.
1676 */
1677
--- src/db.c
+++ src/db.c
@@ -1666,11 +1666,13 @@
1666 while( db.pAllStmt ){
1667 db_finalize(db.pAllStmt);
1668 }
1669 db_end_transaction(1);
1670 pStmt = 0;
1671 g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */
1672 sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0);
1673 g.dbIgnoreErrors--;
1674 db_close_config();
1675
1676 /* If the localdb has a lot of unused free space,
1677 ** then VACUUM it as we shut down.
1678 */
1679

Keyboard Shortcuts

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