Fossil SCM
More missing db_unprotect() calls.
Commit
06d3789a2ad847c6e8b35485318353998d2862eb81b91bb9ca8770113f1465ef
Parent
a64e384f0c53ddc…
4 files changed
+2
+2
+1
+1
+2
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -238,11 +238,13 @@ | ||
| 238 | 238 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 239 | 239 | if( db_int(0, "PRAGMA page_count")>1000 |
| 240 | 240 | && db_int(0, "PRAGMA page_size")<8192 ){ |
| 241 | 241 | db_multi_exec("PRAGMA page_size=8192;"); |
| 242 | 242 | } |
| 243 | + db_unprotect(PROTECT_ALL); | |
| 243 | 244 | db_multi_exec("VACUUM"); |
| 245 | + db_protect_pop(); | |
| 244 | 246 | fossil_print("\nproject-id: %s\n", db_get("project-code", 0)); |
| 245 | 247 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 246 | 248 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 247 | 249 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 248 | 250 | } |
| 249 | 251 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -238,11 +238,13 @@ | |
| 238 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 239 | if( db_int(0, "PRAGMA page_count")>1000 |
| 240 | && db_int(0, "PRAGMA page_size")<8192 ){ |
| 241 | db_multi_exec("PRAGMA page_size=8192;"); |
| 242 | } |
| 243 | db_multi_exec("VACUUM"); |
| 244 | fossil_print("\nproject-id: %s\n", db_get("project-code", 0)); |
| 245 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 246 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 247 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 248 | } |
| 249 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -238,11 +238,13 @@ | |
| 238 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 239 | if( db_int(0, "PRAGMA page_count")>1000 |
| 240 | && db_int(0, "PRAGMA page_size")<8192 ){ |
| 241 | db_multi_exec("PRAGMA page_size=8192;"); |
| 242 | } |
| 243 | db_unprotect(PROTECT_ALL); |
| 244 | db_multi_exec("VACUUM"); |
| 245 | db_protect_pop(); |
| 246 | fossil_print("\nproject-id: %s\n", db_get("project-code", 0)); |
| 247 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 248 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 249 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 250 | } |
| 251 |
M
src/db.c
+2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2300,11 +2300,13 @@ | ||
| 2300 | 2300 | */ |
| 2301 | 2301 | if( db_database_slot("localdb")>=0 ){ |
| 2302 | 2302 | int nFree = db_int(0, "PRAGMA localdb.freelist_count"); |
| 2303 | 2303 | int nTotal = db_int(0, "PRAGMA localdb.page_count"); |
| 2304 | 2304 | if( nFree>nTotal/4 ){ |
| 2305 | + db_unprotect(PROTECT_ALL); | |
| 2305 | 2306 | db_multi_exec("VACUUM localdb;"); |
| 2307 | + db_protect_pop(); | |
| 2306 | 2308 | } |
| 2307 | 2309 | } |
| 2308 | 2310 | |
| 2309 | 2311 | if( g.db ){ |
| 2310 | 2312 | int rc; |
| 2311 | 2313 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2300,11 +2300,13 @@ | |
| 2300 | */ |
| 2301 | if( db_database_slot("localdb")>=0 ){ |
| 2302 | int nFree = db_int(0, "PRAGMA localdb.freelist_count"); |
| 2303 | int nTotal = db_int(0, "PRAGMA localdb.page_count"); |
| 2304 | if( nFree>nTotal/4 ){ |
| 2305 | db_multi_exec("VACUUM localdb;"); |
| 2306 | } |
| 2307 | } |
| 2308 | |
| 2309 | if( g.db ){ |
| 2310 | int rc; |
| 2311 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2300,11 +2300,13 @@ | |
| 2300 | */ |
| 2301 | if( db_database_slot("localdb")>=0 ){ |
| 2302 | int nFree = db_int(0, "PRAGMA localdb.freelist_count"); |
| 2303 | int nTotal = db_int(0, "PRAGMA localdb.page_count"); |
| 2304 | if( nFree>nTotal/4 ){ |
| 2305 | db_unprotect(PROTECT_ALL); |
| 2306 | db_multi_exec("VACUUM localdb;"); |
| 2307 | db_protect_pop(); |
| 2308 | } |
| 2309 | } |
| 2310 | |
| 2311 | if( g.db ){ |
| 2312 | int rc; |
| 2313 |
+1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1759,10 +1759,11 @@ | ||
| 1759 | 1759 | if( forceFlag ) file_delete(g.argv[2]); |
| 1760 | 1760 | db_create_repository(g.argv[2]); |
| 1761 | 1761 | } |
| 1762 | 1762 | db_open_repository(g.argv[2]); |
| 1763 | 1763 | db_open_config(0, 0); |
| 1764 | + db_unprotect(PROTECT_ALL); | |
| 1764 | 1765 | |
| 1765 | 1766 | db_begin_transaction(); |
| 1766 | 1767 | if( !incrFlag ){ |
| 1767 | 1768 | db_initial_setup(0, 0, zDefaultUser); |
| 1768 | 1769 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1769 | 1770 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1759,10 +1759,11 @@ | |
| 1759 | if( forceFlag ) file_delete(g.argv[2]); |
| 1760 | db_create_repository(g.argv[2]); |
| 1761 | } |
| 1762 | db_open_repository(g.argv[2]); |
| 1763 | db_open_config(0, 0); |
| 1764 | |
| 1765 | db_begin_transaction(); |
| 1766 | if( !incrFlag ){ |
| 1767 | db_initial_setup(0, 0, zDefaultUser); |
| 1768 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1769 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1759,10 +1759,11 @@ | |
| 1759 | if( forceFlag ) file_delete(g.argv[2]); |
| 1760 | db_create_repository(g.argv[2]); |
| 1761 | } |
| 1762 | db_open_repository(g.argv[2]); |
| 1763 | db_open_config(0, 0); |
| 1764 | db_unprotect(PROTECT_ALL); |
| 1765 | |
| 1766 | db_begin_transaction(); |
| 1767 | if( !incrFlag ){ |
| 1768 | db_initial_setup(0, 0, zDefaultUser); |
| 1769 | db_set("main-branch", gimport.zTrunkName, 0); |
| 1770 |
+1
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -545,7 +545,8 @@ | ||
| 545 | 545 | } |
| 546 | 546 | }else{ |
| 547 | 547 | fossil_fatal("backup \"%s\" already exists", zDest); |
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | + db_unprotect(PROTECT_ALL); | |
| 550 | 551 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 551 | 552 | } |
| 552 | 553 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -545,7 +545,8 @@ | |
| 545 | } |
| 546 | }else{ |
| 547 | fossil_fatal("backup \"%s\" already exists", zDest); |
| 548 | } |
| 549 | } |
| 550 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 551 | } |
| 552 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -545,7 +545,8 @@ | |
| 545 | } |
| 546 | }else{ |
| 547 | fossil_fatal("backup \"%s\" already exists", zDest); |
| 548 | } |
| 549 | } |
| 550 | db_unprotect(PROTECT_ALL); |
| 551 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 552 | } |
| 553 |