mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Allow the VACUUM following SQLITE_DBCONFIG_RESET_DATABASE to proceed even
if the write-version in the header indicates that the database file is not writable. FossilOrigin-Name: 3dca8b9d5ab1f35f17fc527d8f2a20b6bac989d1406c883d5b4d6719953ef6b4
This commit is contained in:
15
manifest
15
manifest
@@ -1,5 +1,5 @@
|
||||
C Add\sthe\sSQLITE_FCNTL_DATA_VERSION\sfile\scontrol
|
||||
D 2018-07-18T19:09:07.674
|
||||
C Allow\sthe\sVACUUM\sfollowing\sSQLITE_DBCONFIG_RESET_DATABASE\sto\sproceed\seven\nif\sthe\swrite-version\sin\sthe\sheader\sindicates\sthat\sthe\sdatabase\sfile\sis\snot\nwritable.
|
||||
D 2018-07-19T14:40:41.861
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6
|
||||
@@ -438,7 +438,7 @@ F src/auth.c a38f3c63c974787ecf75e3213f8cac6568b9a7af7591fb0372ec0517dd16dca8
|
||||
F src/backup.c 78d3cecfbe28230a3a9a1793e2ead609f469be43e8f486ca996006be551857ab
|
||||
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
|
||||
F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
|
||||
F src/btree.c d9dcccd604aa8b128a20b195001570a46c354525d7abe165b1256ba1ffc307d1
|
||||
F src/btree.c 4b91880ab0f6595c52f13b17f3ef269062073341c254311b3c38925db5b89b9a
|
||||
F src/btree.h febb2e817be499570b7a2e32a9bbb4b607a9234f6b84bb9ae84916d4806e96f2
|
||||
F src/btreeInt.h 620ab4c7235f43572cf3ac2ac8723cbdf68073be4d29da24897c7b77dda5fd96
|
||||
F src/build.c d8f6ac1e9e484eb3f3921a8336d3dc6c87273d9db8729702162ef045997a1463
|
||||
@@ -1181,7 +1181,7 @@ F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c
|
||||
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
|
||||
F test/releasetest.tcl 769892f81050b3f59c66f274d478d855159b474ea27019dec82f1215c0b91ef7 x
|
||||
F test/resetdb.test c70ac9b8ceef3ccb094e22df19d5e7c283b1fb2f729c544c5c211aa58057f4aa
|
||||
F test/resetdb.test b7df373608a56b1fc7a9ed942e8d91fa3ad25b87b63bdb36c88811ad1d0a9c90
|
||||
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
|
||||
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
|
||||
F test/rollback2.test bc868d57899dc6972e2b4483faae0e03365a0556941474eec487ae21d8d38bb6
|
||||
@@ -1750,7 +1750,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 4c70ea5b0e2a512c6a46ac1f14397720e8c8556875701e78c30b19f850c24f55
|
||||
R 77c9c3d812b42dbbcdaf40ac46fb4612
|
||||
P a5087c5c87ad65f92e3bc96bbc84afb43faf10ab6b9ed3ba16304b5c60ad069f e2394002d02754bb45d56e805df9bc5a2ef0d14e5d94262c1f8ab7643bc27c8f
|
||||
R cc038e87dc659a807799369c4759d0af
|
||||
T +closed e2394002d02754bb45d56e805df9bc5a2ef0d14e5d94262c1f8ab7643bc27c8f
|
||||
U drh
|
||||
Z 68e40ab59c72a085fa81a9bdc778d1c6
|
||||
Z ef1b233b53118b1e787b272f555289dd
|
||||
|
||||
@@ -1 +1 @@
|
||||
a5087c5c87ad65f92e3bc96bbc84afb43faf10ab6b9ed3ba16304b5c60ad069f
|
||||
3dca8b9d5ab1f35f17fc527d8f2a20b6bac989d1406c883d5b4d6719953ef6b4
|
||||
@@ -3316,6 +3316,12 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVersion){
|
||||
}
|
||||
assert( pBt->inTransaction==TRANS_WRITE || IfNotOmitAV(pBt->bDoTruncate)==0 );
|
||||
|
||||
if( (p->db->flags & SQLITE_ResetDatabase)
|
||||
&& sqlite3PagerIsreadonly(pBt->pPager)==0
|
||||
){
|
||||
pBt->btsFlags &= ~BTS_READ_ONLY;
|
||||
}
|
||||
|
||||
/* Write transactions are not possible on a read-only database */
|
||||
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){
|
||||
rc = SQLITE_READONLY;
|
||||
|
||||
@@ -207,5 +207,39 @@ do_execsql_test -db db2 630 {
|
||||
SELECT * FROM sqlite_master
|
||||
} {}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 700 {
|
||||
PRAGMA page_size=512;
|
||||
CREATE TABLE t1(a,b,c);
|
||||
CREATE INDEX t1a ON t1(a);
|
||||
CREATE INDEX t1bc ON t1(b,c);
|
||||
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<10)
|
||||
INSERT INTO t1(a,b,c) SELECT x, randomblob(100),randomblob(100) FROM c;
|
||||
PRAGMA page_count;
|
||||
PRAGMA integrity_check;
|
||||
} {19 ok}
|
||||
|
||||
do_execsql_test 710 {
|
||||
UPDATE sqlite_dbpage SET data=
|
||||
X'53514C69746520666F726D61742033000200030100402020000000000000001300000000000000000000000300000004000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000D00000003017C0001D801AC017C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002E03061715110145696E6465787431626374310443524541544520494E4445582074316263204F4E20743128622C63292A0206171311013F696E64657874316174310343524541544520494E44455820743161204F4E20743128612926010617111101397461626C657431743102435245415445205441424C4520743128612C622C6329' WHERE pgno=1;
|
||||
}
|
||||
|
||||
do_execsql_test 720 {
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
|
||||
do_test 730 {
|
||||
sqlite3_db_config db RESET_DB 1
|
||||
db eval VACUUM
|
||||
sqlite3_db_config db RESET_DB 0
|
||||
} {0}
|
||||
|
||||
do_execsql_test 740 {
|
||||
PRAGMA page_count;
|
||||
PRAGMA integrity_check;
|
||||
} {1 ok}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user