From: dan Date: Fri, 30 Jul 2010 10:09:12 +0000 (+0000) Subject: Add the test cases for bug [f3e5abed55]. X-Git-Tag: version-3.7.2~53^2~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2554ea7b0bac21683d265120bb2608ea3ea13d3d;p=thirdparty%2Fsqlite.git Add the test cases for bug [f3e5abed55]. FossilOrigin-Name: cbbaf8e67a23dc332ce935bc7234246eacba60bf --- diff --git a/manifest b/manifest index 77245c477f..a82fdbb928 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sa\sconnection\shas\san\sexclusive\slock\son\sall\sdatabase\sfiles\sinvolved\sin\sa\smulti-file\stransaction\sbefore\swriting\sthe\smaster-journal\spointer\sinto\sany\sjournal\sfiles.\sFix\sfor\s[f3e5abed55]. -D 2010-07-30T10:02:24 +C Add\sthe\stest\scases\sfor\sbug\s[f3e5abed55]. +D 2010-07-30T10:09:12 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -222,7 +222,7 @@ F src/vdbe.c cefff41564b68a412e65e6a1013ec1b1c1ece6c4 F src/vdbe.h 4de0efb4b0fdaaa900cf419b35c458933ef1c6d2 F src/vdbeInt.h ffd68c4d4229227a5089bec53a1c635146177abc F src/vdbeapi.c d0f4407e465f261780ad725c1caece7d66a6aa35 -F src/vdbeaux.c bb14feb1f210aec69889e145cc41b466319bfd2b +F src/vdbeaux.c 8a443e73760ca65ffdfda3e26df4c8c90eeefa11 F src/vdbeblob.c 258a6010ba7a82b72b327fb24c55790655689256 F src/vdbemem.c 5e579abf6532001dfbee0e640dc34eae897a9807 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2 @@ -646,6 +646,7 @@ F test/tkt-9d68c883.test 458f7d82a523d7644b54b497c986378a7d8c8b67 F test/tkt-cbd054fa6b.test f14f97ea43662e6f70c9e63287081e8be5d9d589 F test/tkt-d11f09d36e.test fb44f7961aa6d4b632fb7b9768239832210b5fc7 F test/tkt-d82e3f3721.test 731359dfdcdb36fea0559cd33fec39dd0ceae8e6 +F test/tkt-f3e5abed55.test 91713833e266fbdc60f2030e05647ad4762073f6 F test/tkt-f777251dc7a.test 6f24c053bc5cdb7e1e19be9a72c8887cf41d5e87 F test/tkt-f973c7ac31.test 1da0ed15ec2c7749fb5ce2828cd69d07153ad9f4 F test/tkt-fc62af4523.test 72825d3febdedcd5593a27989fc05accdbfc2bb4 @@ -840,7 +841,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P fb847d70407b0f0e548919b7554f62bc1dab8a6c -R ed4b8e20864f45ad745b5c55b793d01a +P 50c0f2202d21bbf6b593d75fd20f13c0fac23eff +R 90c2b80ec44f603bca769c7fc17c6688 U dan -Z a4643485bfc292d567c95a06fb090017 +Z 1b5da3789844ce06cb648b709ee8c441 diff --git a/manifest.uuid b/manifest.uuid index 2866ee3183..b6eb3e72e3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -50c0f2202d21bbf6b593d75fd20f13c0fac23eff \ No newline at end of file +cbbaf8e67a23dc332ce935bc7234246eacba60bf \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 46748a9530..295a8c3a8d 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1802,6 +1802,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ } } sqlite3OsCloseFree(pMaster); + assert( rc!=SQLITE_BUSY ); if( rc!=SQLITE_OK ){ sqlite3DbFree(db, zMaster); return rc; diff --git a/test/tkt-f3e5abed55.test b/test/tkt-f3e5abed55.test new file mode 100644 index 0000000000..d574480b24 --- /dev/null +++ b/test/tkt-f3e5abed55.test @@ -0,0 +1,113 @@ +# 2010 July 29 +# +# 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/malloc_common.tcl + +foreach f [glob -nocomplain test.db*mj*] { file delete -force $f } +file delete -force test.db2 + +do_test tkt-f3e5abed55-1.1 { + execsql { + ATTACH 'test.db2' AS aux; + CREATE TABLE main.t1(a, b); + CREATE TABLE aux.t2(c, d); + } +} {} + +do_test tkt-f3e5abed55-1.2 { + glob -nocomplain test.db*mj* +} {} + +do_test tkt-f3e5abed55-1.3 { + sqlite3 db2 test.db + execsql { BEGIN; SELECT * FROM t1 } db2 +} {} + +do_test tkt-f3e5abed55-1.4 { + execsql { + BEGIN; + INSERT INTO t1 VALUES(1, 2); + INSERT INTO t2 VALUES(1, 2); + } + catchsql COMMIT +} {1 {database is locked}} + +do_test tkt-f3e5abed55-1.5 { + execsql COMMIT db2 + execsql COMMIT +} {} + +do_test tkt-f3e5abed55-1.6 { + glob -nocomplain test.db*mj* +} {} +foreach f [glob -nocomplain test.db*mj*] { file delete -force $f } +db close +db2 close + + + +# Set up a testvfs so that the next time SQLite tries to delete the +# file "test.db-journal", a snapshot of the current file-system contents +# is taken. +# +testvfs tvfs -default 1 +tvfs script xDelete +tvfs filter xDelete +proc xDelete {method file args} { + if {[file tail $file] == "test.db-journal"} { + faultsim_save + tvfs filter {} + } + return "SQLITE_OK" +} + +sqlite3 db test.db +sqlite3 db2 test.db +do_test tkt-f3e5abed55-2.1 { + execsql { + ATTACH 'test.db2' AS aux; + BEGIN; + INSERT INTO t1 VALUES(3, 4); + INSERT INTO t2 VALUES(3, 4); + } +} {} +do_test tkt-f3e5abed55-2.2 { + execsql { BEGIN; SELECT * FROM t1 } db2 +} {1 2} +do_test tkt-f3e5abed55-2.3 { + catchsql COMMIT +} {1 {database is locked}} + +do_test tkt-f3e5abed55-2.4 { + execsql COMMIT db2 + execsql { + COMMIT; + SELECT * FROM t1; + SELECT * FROM t2; + } +} {1 2 3 4 1 2 3 4} +do_test tkt-f3e5abed55-2.5 { + db close + db2 close + faultsim_restore_and_reopen + execsql { + ATTACH 'test.db2' AS aux; + SELECT * FROM t1; + SELECT * FROM t2; + } +} {1 2 3 4 1 2 3 4} + + +finish_test +