-C Merge\slatest\sbegin-concurrent\schanges\sinto\sthis\sbranch.
-D 2017-12-12T18:17:09.710
+C Fix\sa\sspurious\sSQLITE_CORRUPT\serror\sthat\scould\soccur\swithin\sa\sCOMMIT\sof\sa\nconcurrent\stransaction.
+D 2018-01-02T19:57:26.765
F Makefile.in b142eb20482922153ebc77b261cdfd0a560ed05a81e9f6d9a2b0e8192922a1d2
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc a55372a22454e742ba7c8f6edf05b83213ec01125166ad7dcee0567e2f7fc81b
F src/backup.c faf17e60b43233c214aae6a8179d24503a61e83b
F src/bitvec.c 8433d9e98dd6f2ea3286e0d2fe5d65de1bfc18a706486eb2026b01be066b5806
F src/btmutex.c 0e9ce2d56159b89b9bc8e197e023ee11e39ff8ca
-F src/btree.c a41d580524a4cd9b00443b7196d298e05463f6bfcb712853db3abcddc93cf3ab
+F src/btree.c c3e15a9e5726fa3f426322cccaf9fe972dc9b3d9e07921220286f9076413f71d
F src/btree.h feafd0647331366f4ef17f7e68597e9029f001e7ab16a125e2f176c598a7ef4a
F src/btreeInt.h 0e0abe97427b4139092ec8782d396a4ad18566964e992c60043e370d4c86fd99
F src/build.c f890a66f2b78cd820b21b580f37605f8dd77f19d0b35f5850a675c88a815adca
F test/concurrent3.test f4af1cf1220908c6dd5694923621c19e999b78cd997e2646285f08a52bcb4170
F test/concurrent4.test e0b12cd467137e50259df3b4f837507e82aaa07c35941c88664dc8ed1d089c44
F test/concurrent5.test d5d7d9d404a9b4502464fc097c1fc5c3012bb4f1b063fae7ad707ca983fc86c5
+F test/concurrent6.test a7860e9ca13bb5fb76bcf41c5524fbfa9c37e6e258ecf84ffb5748a272488c67
F test/conflict.test 029faa2d81a0d1cafb5f88614beb663d972c01db
F test/conflict2.test bb0b94cf7196c64a3cbd815c66d3ee98c2fecd9c
F test/conflict3.test a83db76a6c3503b2fa057c7bfb08c318d8a422202d8bc5b86226e078e5b49ff9
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P bdf791f9f7f7ab4b1871e1d3a0d5edcad46fc67d7336ae7f3f7b20e69801be8e 163c870950f386f6b0bb1ff9b3886cf95ba0deed414cae75baf87621ed3528c2
-R 99497e88454df0f5b4640ad740c855cd
+P 3fde0b4d05c249b9d2a54dd721185202c353cee23c0351b634cac349dc0a7b14
+R 131f3c49cbacffd5469d66a498022e8f
U dan
-Z 55bd54709eec1e2f156a3a0d8460b930
+Z 25c8423f0f81f25c528eab1972eef804
-3fde0b4d05c249b9d2a54dd721185202c353cee23c0351b634cac349dc0a7b14
\ No newline at end of file
+50c8952c92b9f0c61935fb0df04ed1426d9e266a812071b7bf5b0215c5552757
\ No newline at end of file
/* The current transaction allocated pages pMap->iFirst through
** nPage (inclusive) at the end of the database file. Meanwhile,
** other transactions have allocated (iFirst..nHPage). So move
- ** pages (iFirst..MIN(nPage,nHPage)) to (MAX(nPage,nHPage)+1). */
+ ** pages (iFirst..MIN(nPage,nHPage)) to (MAX(nPage,nHPage)+1). */
Pgno iLast = MIN(nPage, nHPage); /* Last page to move */
Pgno nCurrent; /* Current size of db */
+
nCurrent = MAX(nPage, nHPage);
+ pBt->nPage = nCurrent;
rc = btreeRelocateRange(pBt, pMap->iFirst, iLast, &nCurrent);
/* There are now no collisions with the snapshot at the head of the
** stores stores the total number of pages on the freelist. */
n = get4byte(&pPage1->aData[36]);
testcase( n==mxPage-1 );
- if( ISCONCURRENT==0 && n>=mxPage ){
+ if( n>=mxPage ){
return SQLITE_CORRUPT_BKPT;
}
--- /dev/null
+# 2017 May 26
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/lock_common.tcl
+source $testdir/wal_common.tcl
+set ::testprefix concurrent6
+
+ifcapable !concurrent {
+ finish_test
+ return
+}
+
+sqlite3 db2 test.db
+
+do_execsql_test 1.0 {
+ PRAGMA page_size = 1024;
+ PRAGMA journal_mode = wal;
+ CREATE TABLE t1(x);
+ CREATE TABLE t2(x);
+ CREATE TABLE t3(x);
+ CREATE TABLE t4(x);
+
+ INSERT INTO t1 VALUES(zeroblob(1500));
+} {wal}
+
+do_execsql_test -db db2 1.1 {
+ BEGIN CONCURRENT;
+ INSERT INTO t3 VALUES(zeroblob(4000));
+ DELETE FROM t1;
+}
+
+do_execsql_test 1.2 {
+ WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100)
+ INSERT INTO t2 SELECT zeroblob(1000) FROM s;
+
+ WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100)
+ INSERT INTO t4 SELECT zeroblob(1000) FROM s;
+
+ DELETE FROM t4;
+}
+
+do_execsql_test -db db2 1.3 {
+ COMMIT;
+}
+
+
+finish_test
+