Fossil SCM
Suppress "database locked" warnings on the "PRAGMA optimize" that occurs as the process is shutting down.
Commit
41956e7000813c3c3d26292401471b266b63b2218a41bf79461ae8f76fb2dc52
Parent
4d2c34b0d70fb86…
1 file changed
+2
M
src/db.c
+2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1666,11 +1666,13 @@ | ||
| 1666 | 1666 | while( db.pAllStmt ){ |
| 1667 | 1667 | db_finalize(db.pAllStmt); |
| 1668 | 1668 | } |
| 1669 | 1669 | db_end_transaction(1); |
| 1670 | 1670 | pStmt = 0; |
| 1671 | + g.dbIgnoreErrors++; /* Stop "database locked" warnings from PRAGMA optimize */ | |
| 1671 | 1672 | sqlite3_exec(g.db, "PRAGMA optimize", 0, 0, 0); |
| 1673 | + g.dbIgnoreErrors--; | |
| 1672 | 1674 | db_close_config(); |
| 1673 | 1675 | |
| 1674 | 1676 | /* If the localdb has a lot of unused free space, |
| 1675 | 1677 | ** then VACUUM it as we shut down. |
| 1676 | 1678 | */ |
| 1677 | 1679 |
| --- 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 |