mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
In btree.c, save the positions of other cursors open on the same table when writing via an incremental blob handle. Otherwise, they may be left holding an out-of-date xFetch page reference.
FossilOrigin-Name: 3f09fba18f7e61e21381ffea13c31b968efd7d77
This commit is contained in:
16
manifest
16
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Initialize\sthe\smmap_limit\sof\stemporary\sfiles\sto\sthe\sconfigured\smmap_limit.
|
C In\sbtree.c,\ssave\sthe\spositions\sof\sother\scursors\sopen\son\sthe\ssame\stable\swhen\swriting\svia\san\sincremental\sblob\shandle.\sOtherwise,\sthey\smay\sbe\sleft\sholding\san\sout-of-date\sxFetch\spage\sreference.
|
||||||
D 2013-04-03T10:50:02.049
|
D 2013-04-03T11:17:39.067
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in df3e48659d80e1b7765785d8d66c86b320f72cc7
|
F Makefile.in df3e48659d80e1b7765785d8d66c86b320f72cc7
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -121,7 +121,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
|||||||
F src/backup.c b266767351ae2d847716c56fcb2a1fea7c761c03
|
F src/backup.c b266767351ae2d847716c56fcb2a1fea7c761c03
|
||||||
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
|
F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
|
||||||
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
|
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
|
||||||
F src/btree.c bb679fddb7269dd7cfb950f845b1b18f19df4f4a
|
F src/btree.c b38cb3a1758d46e76bec080994fed7313622687d
|
||||||
F src/btree.h d9490cd37aaeb530a41b07f06e1262950b1be916
|
F src/btree.h d9490cd37aaeb530a41b07f06e1262950b1be916
|
||||||
F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
|
F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
|
||||||
F src/build.c 083da8466fd7e481cb8bd5264398f537507f6176
|
F src/build.c 083da8466fd7e481cb8bd5264398f537507f6176
|
||||||
@@ -631,7 +631,7 @@ F test/misc5.test 528468b26d03303b1f047146e5eefc941b9069f5
|
|||||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||||
F test/misc7.test dd82ec9250b89178b96cd28b2aca70639d21e5b3
|
F test/misc7.test dd82ec9250b89178b96cd28b2aca70639d21e5b3
|
||||||
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
|
F test/misuse.test ba4fb5d1a6101d1c171ea38b3c613d0661c83054
|
||||||
F test/mmap1.test 95f8f90b7f4e1ef3499ea5cc69a9c3e7b1d36227
|
F test/mmap1.test 9f4cee0877549c80b13acd688c775254b2d61ec7
|
||||||
F test/mmap2.test c0cbb978eda8d06d755ba8d9e59ec06ebf60c5cb
|
F test/mmap2.test c0cbb978eda8d06d755ba8d9e59ec06ebf60c5cb
|
||||||
F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256
|
F test/multiplex.test e08cc7177bd6d85990ee1d71100bb6c684c02256
|
||||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||||
@@ -1042,7 +1042,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
|
||||||
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
|
||||||
P 83bc37af07857960c11275891f853a358dcbbf05
|
P 24bab7596bb7385981a5d331df5eeb05353547f7
|
||||||
R 32aa00c0c8e64a488f9b37d8aa36924f
|
R 5d2a80f93297e2bae93eb7d43d59c6c0
|
||||||
U drh
|
U dan
|
||||||
Z db8bee74489339af40a69aa3740a7e67
|
Z a5b2fa9ebb6e4e86d546b82b43bf4939
|
||||||
|
@@ -1 +1 @@
|
|||||||
24bab7596bb7385981a5d331df5eeb05353547f7
|
3f09fba18f7e61e21381ffea13c31b968efd7d77
|
@@ -8400,6 +8400,15 @@ int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
|
|||||||
return SQLITE_ABORT;
|
return SQLITE_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Save the positions of all other cursors open on this table. This is
|
||||||
|
** required in case any of them are holding references to an xFetch
|
||||||
|
** version of the b-tree page modified by the accessPayload call below.
|
||||||
|
*/
|
||||||
|
rc = saveAllCursors(pCsr->pBt, pCsr->pgnoRoot, pCsr);
|
||||||
|
if( rc!=SQLITE_OK ){
|
||||||
|
return SQLITE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check some assumptions:
|
/* Check some assumptions:
|
||||||
** (a) the cursor is open for writing,
|
** (a) the cursor is open for writing,
|
||||||
** (b) there is a read/write transaction open,
|
** (b) there is a read/write transaction open,
|
||||||
|
@@ -157,4 +157,55 @@ do_test 3.2 {
|
|||||||
set nRow
|
set nRow
|
||||||
} {8}
|
} {8}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
# Ensure that existing cursors using xFetch() pages see changes made
|
||||||
|
# to rows using the incrblob API.
|
||||||
|
#
|
||||||
|
reset_db
|
||||||
|
set aaa [string repeat a 400]
|
||||||
|
set bbb [string repeat b 400]
|
||||||
|
set ccc [string repeat c 400]
|
||||||
|
set ddd [string repeat d 400]
|
||||||
|
set eee [string repeat e 400]
|
||||||
|
|
||||||
|
do_execsql_test 4.1 {
|
||||||
|
PRAGMA page_size = 1024;
|
||||||
|
CREATE TABLE t1(x);
|
||||||
|
INSERT INTO t1 VALUES($aaa);
|
||||||
|
INSERT INTO t1 VALUES($bbb);
|
||||||
|
INSERT INTO t1 VALUES($ccc);
|
||||||
|
INSERT INTO t1 VALUES($ddd);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
BEGIN;
|
||||||
|
} [list $aaa $bbb $ccc $ddd]
|
||||||
|
|
||||||
|
do_test 4.2 {
|
||||||
|
set ::STMT [sqlite3_prepare db "SELECT * FROM t1 ORDER BY rowid" -1 dummy]
|
||||||
|
sqlite3_step $::STMT
|
||||||
|
sqlite3_column_text $::STMT 0
|
||||||
|
} $aaa
|
||||||
|
|
||||||
|
do_test 4.3 {
|
||||||
|
foreach r {2 3 4} {
|
||||||
|
set fd [db incrblob t1 x $r]
|
||||||
|
puts -nonewline $fd $eee
|
||||||
|
close $fd
|
||||||
|
}
|
||||||
|
|
||||||
|
set res [list]
|
||||||
|
while {"SQLITE_ROW" == [sqlite3_step $::STMT]} {
|
||||||
|
lappend res [sqlite3_column_text $::STMT 0]
|
||||||
|
}
|
||||||
|
set res
|
||||||
|
} [list $eee $eee $eee]
|
||||||
|
|
||||||
|
do_test 4.4 {
|
||||||
|
sqlite3_finalize $::STMT
|
||||||
|
} SQLITE_OK
|
||||||
|
|
||||||
|
do_execsql_test 4.5 { COMMIT }
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user