]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a problem with committing a transaction while there are other active statements...
authordanielk1977 <danielk1977@noemail.net>
Wed, 14 Jan 2009 17:45:57 +0000 (17:45 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 14 Jan 2009 17:45:57 +0000 (17:45 +0000)
FossilOrigin-Name: b7d2a477aa2c3dbbb81d18fba1faa6835711b5c3

manifest
manifest.uuid
src/pager.c
test/lock.test

index 9d70885499973347e4d3397b3d7fe634f7e6ec48..c03bda915da753e5dd1bdb32d0c7702c8be9f5e2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Version\s3.6.9\s(CVS\s6175)
-D 2009-01-14T04:09:36
+C Fix\sa\sproblem\swith\scommitting\sa\stransaction\swhile\sthere\sare\sother\sactive\sstatements.\sSometimes,\sthe\sdatabase\schange\scounter\swas\snot\sbeing\supdated.\s(CVS\s6176)
+D 2009-01-14T17:45:58
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 05461a9b5803d5ad10c79f989801e9fd2cc3e592
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -142,7 +142,7 @@ F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
 F src/os_unix.c 7825c6178597713382d74adbf8c8c00ffcdc42d4
 F src/os_win.c 496e3ceb499aedc63622a89ef76f7af2dd902709
-F src/pager.c 5a95868f4fe0efd2ec51f89efce470e9d63d6fed
+F src/pager.c add3461c2dedf56e56d8d18d3506b6cc322fa363
 F src/pager.h 9870acb2d653848d90d765d7cbf163496d6c8111
 F src/parse.y 4d0e33a702dc3ea7b69d8ae1914b3fbd32e46057
 F src/pcache.c 16dc8da6e6ba6250f8dfd9ee46036db1cbceedc6
@@ -421,7 +421,7 @@ F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
 F test/limit.test 2db7b3b34fb925b8e847d583d2eb67531d0ce67e
 F test/loadext.test 18db29c081380fdedcfbd8c633847712059ae104
 F test/loadext2.test 0bcaeb4d81cd5b6e883fdfea3c1bdbe1f173cbca
-F test/lock.test a280c87f86cfe25ac8899bd6cdfd23ffc5aca40a
+F test/lock.test 3f03827e056946c4b81b74006e62ffa2a3219ab3
 F test/lock2.test 018b846f6f3b3b695fad07e317b7988442b556f4
 F test/lock3.test 8adfbf438b96316267611214d494ebc1311b8cda
 F test/lock4.test 09d97d52cae18fadfe631552af9880dac6b3ae90
@@ -697,7 +697,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P f5f5ef646bef6de6a744b565e089219d4e47397d
-R 4f97314454171316749f2eb51c07be84
-U drh
-Z d65a6a30099596d50d6572a776a8f3b0
+P b6ce8199a9286eb2d0a590abc8ef080594d84f83
+R ca33b022189d9e81c917d579a0524de0
+U danielk1977
+Z 675d862fdbda95891d2940f72045246e
index 7026e03c24d3e05428600d600adbc02525955b74..465f38b8c94ca4d62c873b01ec9c586ff8a1e278 100644 (file)
@@ -1 +1 @@
-b6ce8199a9286eb2d0a590abc8ef080594d84f83
\ No newline at end of file
+b7d2a477aa2c3dbbb81d18fba1faa6835711b5c3
\ No newline at end of file
index 45a5d0ab304f3acc20e0db304f834e6c547b1246..55dc04bd5d3b1e79f76fffc46527f5b67be3e4a1 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.549 2009/01/13 16:03:44 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.550 2009/01/14 17:45:58 danielk1977 Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -1105,6 +1105,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){
   if( !pPager->exclusiveMode ){
     rc2 = osUnlock(pPager->fd, SHARED_LOCK);
     pPager->state = PAGER_SHARED;
+    pPager->changeCountDone = 0;
   }else if( pPager->state==PAGER_SYNCED ){
     pPager->state = PAGER_EXCLUSIVE;
   }
index b20303adc0305c42d9e464c312780b16de283b09..30469d5b9df0563a0f73656bbcaafc50a301dfe6 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this script is database locks.
 #
-# $Id: lock.test,v 1.34 2008/11/21 22:21:51 drh Exp $
+# $Id: lock.test,v 1.35 2009/01/14 17:45:58 danielk1977 Exp $
 
 
 set testdir [file dirname $argv0]
@@ -350,6 +350,46 @@ ifcapable tempdb {
   } {9}
 }
 
+do_test lock-6.1 {
+  execsql {
+    CREATE TABLE t4(a PRIMARY KEY, b);
+    INSERT INTO t4 VALUES(1, 'one');
+    INSERT INTO t4 VALUES(2, 'two');
+    INSERT INTO t4 VALUES(3, 'three');
+  }
+
+  set STMT [sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 TAIL]
+  sqlite3_step $STMT
+
+  execsql { DELETE FROM t4 }
+  execsql { SELECT * FROM sqlite_master } db2
+  execsql { SELECT * FROM t4 } db2
+} {}
+
+do_test lock-6.2 {
+  execsql { 
+    BEGIN;
+    INSERT INTO t4 VALUES(1, 'one');
+    INSERT INTO t4 VALUES(2, 'two');
+    INSERT INTO t4 VALUES(3, 'three');
+    COMMIT;
+  }
+
+  execsql { SELECT * FROM t4 } db2
+} {1 one 2 two 3 three}
+
+do_test lock-6.3 {
+  execsql { SELECT a FROM t4 ORDER BY a } db2
+} {1 2 3}
+
+do_test lock-6.4 {
+  execsql { PRAGMA integrity_check } db2
+} {ok}
+
+do_test lock-6.5 {
+  sqlite3_finalize $STMT
+} {SQLITE_OK}
+
 do_test lock-999.1 {
   rename db2 {}
 } {}