1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fixes to the test suite (no code changes) so that quick.test runs with OMIT_ATTACH builds. #2706. (CVS 4480)

FossilOrigin-Name: 07c00fffe50e8380748f7ae02328531a75d64610
This commit is contained in:
danielk1977
2007-10-09 08:29:32 +00:00
parent 0cd1ea5e44
commit 5a8f9374ab
39 changed files with 1253 additions and 1158 deletions

View File

@ -1,5 +1,5 @@
C More\suntested\schanges\sfor\swince\scontributed\sby\susers.\s\sTicket\s#2702.\s(CVS\s4479) C Fixes\sto\sthe\stest\ssuite\s(no\scode\schanges)\sso\sthat\squick.test\sruns\swith\sOMIT_ATTACH\sbuilds.\s#2706.\s(CVS\s4480)
D 2007-10-08T15:06:04 D 2007-10-09T08:29:32
F Makefile.in 75b729d562e9525d57d9890ec598b38e1a8b02bc F Makefile.in 75b729d562e9525d57d9890ec598b38e1a8b02bc
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -177,21 +177,21 @@ F src/where.c 44042c8b9d0d054cc318c3a0df052215ebf49d2d
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617 F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/all.test b59d1bd8b0c1d4a08b845e8af48fd43926f01f11 F test/all.test b59d1bd8b0c1d4a08b845e8af48fd43926f01f11
F test/alter.test c2a9402e17a731e5294ef370214bd9f88351d18d F test/alter.test 908659f97a0f97504da2f71ebc14e84b440a52ab
F test/alter2.test 816574fd9302af05e95895758aff2811090c6c78 F test/alter2.test 489140038c13f4f9c76a0a8243eb1249f44d4ce1
F test/alter3.test a6eec8f454be9b6ce73d8d7dc711453675a10ce7 F test/alter3.test 8ce6b9c5605b3cfe7b901f454ecaf174c4f93e31
F test/altermalloc.test 29d4a8400277efb4ba8ffe90804c6dc2fdfbf063 F test/altermalloc.test 29d4a8400277efb4ba8ffe90804c6dc2fdfbf063
F test/analyze.test 2f55535aa335785db1a2f97d3f3831c16c09f8b0 F test/analyze.test 2f55535aa335785db1a2f97d3f3831c16c09f8b0
F test/async.test ae370c6169e314f0f82dcbe59fbc8589b23dfc2f F test/async.test ae370c6169e314f0f82dcbe59fbc8589b23dfc2f
F test/async2.test e56affa75ed822424a6f9b12b22db8031433bb7c F test/async2.test e56affa75ed822424a6f9b12b22db8031433bb7c
F test/async3.test 08ea0217083e4866eb1b0147158298f2a2cd1346 F test/async3.test 08ea0217083e4866eb1b0147158298f2a2cd1346
F test/attach.test 8880661ee05a7fdeb2d3868e66c08aab21cec8f1 F test/attach.test 72529edb04115675894a7399609983ea46b73ba6
F test/attach2.test 78bc1a25ea8785c7571b44f5947ada2bd5d78127 F test/attach2.test 099e46a9a753035ff1b8ec0954e18ea50a934df3
F test/attach3.test eafcafb107585aecc2ed1569a77914138eef46a9 F test/attach3.test 7b92dc8e40c1ebca9732ca6f2d3fefbd46f196df
F test/attachmalloc.test 475c95e9d5756318f62226e2d2299e64ecdbc543 F test/attachmalloc.test 56c5e55563dba6d64641ef2f70ce06900df16912
F test/auth.test 66923137cf78475f5671b5e6e6274935e055aea0 F test/auth.test 6d98da67f40475ff9eba99b4a74954c123ba1792
F test/auth2.test 8da06f0ffcfd98154dda78e0f3b35a6503c27b64 F test/auth2.test 8da06f0ffcfd98154dda78e0f3b35a6503c27b64
F test/autoinc.test 60005a676e3e4e17dfa9dbd08aa0b76587ff97e3 F test/autoinc.test 0e67964f4855081e3a325e484adfebaab41f23a1
F test/autovacuum.test 4339e66003b9cf813dd667a83aed2dee27c4c36d F test/autovacuum.test 4339e66003b9cf813dd667a83aed2dee27c4c36d
F test/autovacuum_crash.test 05a63b8805b20cfba7ace82856ce4ccdda075a31 F test/autovacuum_crash.test 05a63b8805b20cfba7ace82856ce4ccdda075a31
F test/autovacuum_ioerr.test c46a76869cb6eddbbb40b419b2b6c4c001766b1f F test/autovacuum_ioerr.test c46a76869cb6eddbbb40b419b2b6c4c001766b1f
@ -234,7 +234,7 @@ F test/corrupt.test 18c7a995b1af76a8c8600b996257f2c7b7bff083
F test/corrupt2.test 572f8df0303d0ce63ddad5c5c9101a83a345ae46 F test/corrupt2.test 572f8df0303d0ce63ddad5c5c9101a83a345ae46
F test/corrupt3.test 263e8bb04e2728df832fddf6973cf54c91db0c32 F test/corrupt3.test 263e8bb04e2728df832fddf6973cf54c91db0c32
F test/corrupt4.test acdb01afaedf529004b70e55de1a6f5a05ae7fff F test/corrupt4.test acdb01afaedf529004b70e55de1a6f5a05ae7fff
F test/crash.test 24020168cc42977a4dd83ff78d2b5eb6577715db F test/crash.test e8b9385771789851f030045c68fdf369ca030fc6
F test/crash2.test 26d7a4c5520201e5de2c696ea51ab946b59dc0e9 F test/crash2.test 26d7a4c5520201e5de2c696ea51ab946b59dc0e9
F test/crash3.test 0b09687ae1a3ccbcefdfaeb4b963e26e36255d76 F test/crash3.test 0b09687ae1a3ccbcefdfaeb4b963e26e36255d76
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
@ -250,9 +250,9 @@ F test/descidx3.test 3a55b8d73bc3e9ad084e0da7fec781cf0d2a0356
F test/diskfull.test 34ef53e88372c5b5e488ad1581514559a224c2b1 F test/diskfull.test 34ef53e88372c5b5e488ad1581514559a224c2b1
F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
F test/enc2.test 45710bacfa9df29720bc84c067dfdf8c8ddfb797 F test/enc2.test 6d91a5286f59add0cfcbb2d0da913b76f2242398
F test/enc3.test 9331988b9d72decec96995c90637e87b00d747a5 F test/enc3.test 9331988b9d72decec96995c90637e87b00d747a5
F test/exclusive.test 00d5328b243083ccda7729f275eedc6c4e02ae29 F test/exclusive.test ebaf72ce9ff8f7ab3a09bf8f58fd65393dfff386
F test/exclusive2.test d13bf66753dca46e61241d35d36ab7c868b0d313 F test/exclusive2.test d13bf66753dca46e61241d35d36ab7c868b0d313
F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff
F test/expr.test dc50ec4e69f1168eece91f9c18dcff59b718e44c F test/expr.test dc50ec4e69f1168eece91f9c18dcff59b718e44c
@ -311,14 +311,14 @@ F test/fuzz.test 62fc19dd36a427777fd671b569df07166548628a
F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb F test/fuzz2.test ea38692ce2da99ad79fe0be5eb1a452c1c4d37bb
F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731 F test/fuzz_common.tcl ff4bc2dfc465f6878f8e2d819620914365382731
F test/fuzz_malloc.test 166b58dfd77cc04f6afeeaef0cfc1087abf134d1 F test/fuzz_malloc.test 166b58dfd77cc04f6afeeaef0cfc1087abf134d1
F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a F test/hook.test 3870abead2ee75d2c03585c916256ca8b5584679
F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329 F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055 F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
F test/incrblob.test daad09b0d18eb419ac824c9896b7432882f9c0a5 F test/incrblob.test 602dbfa956904d6e58c45635b58850ad0f02d927
F test/incrblob_err.test 5273097dc7c97f9b7008423a6ffd5c80d21923cb F test/incrblob_err.test 5273097dc7c97f9b7008423a6ffd5c80d21923cb
F test/incrvacuum.test 985bc94a7ff544db09aec3a0c93c779280da9415 F test/incrvacuum.test 985bc94a7ff544db09aec3a0c93c779280da9415
F test/incrvacuum2.test 82397ceb5941cbe852fd29bb33fcdf5665bc80c2 F test/incrvacuum2.test a958e378c193c4012cb3787804d863487f1dfad1
F test/incrvacuum_ioerr.test cb331403b8dea3c5bae6163861ff25037b0df56a F test/incrvacuum_ioerr.test cb331403b8dea3c5bae6163861ff25037b0df56a
F test/index.test e65df12bed94b2903ee89987115e1578687e9266 F test/index.test e65df12bed94b2903ee89987115e1578687e9266
F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6 F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6
@ -326,11 +326,11 @@ F test/index3.test f66718cd92ce1216819d47e6a156755e4b2c4ca1
F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908 F test/insert.test aef273dd1cee84cc92407469e6bd1b3cdcb76908
F test/insert2.test 5a20e1ace5fa0800b58d28284212290189b49aed F test/insert2.test 5a20e1ace5fa0800b58d28284212290189b49aed
F test/insert3.test 9a4ef3526fd3cca8b05278020ec3100448b4c677 F test/insert3.test 9a4ef3526fd3cca8b05278020ec3100448b4c677
F test/insert4.test d7d256791e549de24e0a27a213405e1204e7a4dd F test/insert4.test ac36af0ea9e6a2447f0d9b65da512498018a7743
F test/interrupt.test 81555fb0f8179bb2d0dc7151fd75428223f93cf2 F test/interrupt.test 81555fb0f8179bb2d0dc7151fd75428223f93cf2
F test/intpkey.test af4fd826c4784ec5c93b444de07adea0254d0d30 F test/intpkey.test af4fd826c4784ec5c93b444de07adea0254d0d30
F test/io.test a5923f1c45144d167e4faa8b16dc83348038eed0 F test/io.test 835b0ec66166312ff743e2fd11a878c65068de9f
F test/ioerr.test 4b175825ed42b04f935e00f57cfb2a9f0c13de7d F test/ioerr.test ae429185a3a11a318aa7ec64e2188e6119e43bca
F test/ioerr2.test e3d52c40f43f9b61da9b38951a737e7b84ebae96 F test/ioerr2.test e3d52c40f43f9b61da9b38951a737e7b84ebae96
F test/join.test af0443185378b64878750aa1cf4b83c216f246b4 F test/join.test af0443185378b64878750aa1cf4b83c216f246b4
F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324 F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
@ -349,9 +349,9 @@ F test/lock2.test 5f9557b775662c2a5ee435378f39e10d64f65cb3
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9 F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
F test/lock4.test f358fa835dff485d462072eee991111f09e87441 F test/lock4.test f358fa835dff485d462072eee991111f09e87441
F test/main.test 05f585bb70c05caac3e047903b517cbb319ed204 F test/main.test 05f585bb70c05caac3e047903b517cbb319ed204
F test/malloc.test fc062a1233cc0d139a6058caf1b2129bb73f86a1 F test/malloc.test 16ee55742216e3d0fdadb695fb90ad229f46b32c
F test/malloc2.test 1506ab3a4490b38b8850a6fa3e12591235179872 F test/malloc2.test 1506ab3a4490b38b8850a6fa3e12591235179872
F test/malloc3.test cf2efe9d16194276f227f34ac341019e013fb17d F test/malloc3.test 3d690cbd66c93a3d41606ed8cfcbe1c9853e9d83
F test/malloc4.test f0e5e0f639f61e2776a6c3f5308f836b3ad8b3c7 F test/malloc4.test f0e5e0f639f61e2776a6c3f5308f836b3ad8b3c7
F test/malloc5.test 18f3f71756e775a17ce4d0c49d76fb0027dda066 F test/malloc5.test 18f3f71756e775a17ce4d0c49d76fb0027dda066
F test/malloc6.test d05fd71ef3c5983d10e0a6d728ea4a502a45a9e4 F test/malloc6.test d05fd71ef3c5983d10e0a6d728ea4a502a45a9e4
@ -361,7 +361,7 @@ F test/malloc9.test 95d7069ad4fa262bf33bc4c5ca0a46f2bb2391cb
F test/mallocA.test f474c5bdbef4070e11c89d01ba1b0e78f955b97a F test/mallocA.test f474c5bdbef4070e11c89d01ba1b0e78f955b97a
F test/mallocB.test 83bdbea443cc81758a57b0287807b0941218819a F test/mallocB.test 83bdbea443cc81758a57b0287807b0941218819a
F test/mallocC.test 6f02fa2b4baa943bc6d6db323d5d07067967e728 F test/mallocC.test 6f02fa2b4baa943bc6d6db323d5d07067967e728
F test/mallocD.test 473db9092f962685ca5710a153d2abbe3428bb9e F test/mallocD.test d638fb8f214b47fd31edfae8af738b92bd943dc0
F test/malloc_common.tcl b47137fb36e95fdafb0267745afefcd6b0a5b9dc F test/malloc_common.tcl b47137fb36e95fdafb0267745afefcd6b0a5b9dc
F test/manydb.test 8de36b8d33aab5ef295b11d9e95310aeded31af8 F test/manydb.test 8de36b8d33aab5ef295b11d9e95310aeded31af8
F test/memdb.test a67bda4ff90a38f2b19f6c7f95aa7289e051d893 F test/memdb.test a67bda4ff90a38f2b19f6c7f95aa7289e051d893
@ -385,8 +385,8 @@ F test/pager2.test c025f91b75fe65e85febda64d9416428b8a5cab5
F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4 F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4
F test/pageropt.test 51e3c091bc2992f5098f7576e3594e1908988939 F test/pageropt.test 51e3c091bc2992f5098f7576e3594e1908988939
F test/pagesize.test e0a8b3fe80f8b8e808d94a00734c7a18c76c407e F test/pagesize.test e0a8b3fe80f8b8e808d94a00734c7a18c76c407e
F test/pragma.test b0e73879206934a835856a8b8c4cc884cd8562f3 F test/pragma.test ab9ba0fb289ae25982b20bdfa9b4f009de82d49f
F test/pragma2.test 5e063bf1d4dfd6baa885cd1809fcd5b2609e9dab F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47
F test/printf.test 6bf1a86c6a1e45536f72d782bf44c8e3c76510f8 F test/printf.test 6bf1a86c6a1e45536f72d782bf44c8e3c76510f8
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 x F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 x
F test/ptrchng.test 38ae1806833d72d9a81a6121322e274f24937e18 F test/ptrchng.test 38ae1806833d72d9a81a6121322e274f24937e18
@ -397,8 +397,8 @@ F test/reindex.test 38b138abe36bf9a08c791ed44d9f76cd6b97b78b
F test/rollback.test 0bd29070ba2f76da939347773fbda53337ebd61c F test/rollback.test 0bd29070ba2f76da939347773fbda53337ebd61c
F test/rowid.test d125991eea1ffdea800d48471afd8fc4acc10b01 F test/rowid.test d125991eea1ffdea800d48471afd8fc4acc10b01
F test/safety.test 4a06934e45d03b8b50ebcd8d174eb0367d2fd851 F test/safety.test 4a06934e45d03b8b50ebcd8d174eb0367d2fd851
F test/schema.test 401585200727464ef6bb0b3ba0f085f99a87cdce F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c
F test/schema2.test b438d2c7fd627227f405887c2328b4aed5dad012 F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e
F test/select1.test 7603a4d406ea00516233e26539d2fac0cc85e732 F test/select1.test 7603a4d406ea00516233e26539d2fac0cc85e732
F test/select2.test f3c2678c3a9f3cf08ec4988a3845bda64be6d9e3 F test/select2.test f3c2678c3a9f3cf08ec4988a3845bda64be6d9e3
F test/select3.test 47439f28862489626b483b0c718cfb0562e6f6d5 F test/select3.test 47439f28862489626b483b0c718cfb0562e6f6d5
@ -407,7 +407,7 @@ F test/select5.test 0b47058d3e916c1fc9fe81f44b438e02bade21ce
F test/select6.test 399f14b9ba37b768afe5d2cd8c12e4f340a69db8 F test/select6.test 399f14b9ba37b768afe5d2cd8c12e4f340a69db8
F test/select7.test 7906735805cfbee4dddc0bed4c14e68d7f5f9c5f F test/select7.test 7906735805cfbee4dddc0bed4c14e68d7f5f9c5f
F test/server1.test f5b790d4c0498179151ca8a7715a65a7802c859c F test/server1.test f5b790d4c0498179151ca8a7715a65a7802c859c
F test/shared.test 3f27bca85ba3c032c346f895d42d4110cb5288e6 F test/shared.test 56d006ab6a9f1ed9a0dcc642e34ed6d366c3c90f
F test/shared2.test 0ee9de8964d70e451936a48c41cb161d9134ccf4 F test/shared2.test 0ee9de8964d70e451936a48c41cb161d9134ccf4
F test/shared3.test 01e3e124dbb3859788aabc7cfb82f7ea04421749 F test/shared3.test 01e3e124dbb3859788aabc7cfb82f7ea04421749
F test/shared_err.test bfe49fbbf26746a3c05255b1dc7230744182b744 F test/shared_err.test bfe49fbbf26746a3c05255b1dc7230744182b744
@ -417,19 +417,19 @@ F test/softheap1.test 29cbdb847e63ffef3af5da1e3cd15f44ee11d770
F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5 F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5
F test/speed1.test 22e1b27af0683ed44dcd2f93ed817a9c3e65084a F test/speed1.test 22e1b27af0683ed44dcd2f93ed817a9c3e65084a
F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded
F test/speed3.test 688fe59ea7b4eabf62b955447aa6cc3249d69d7d F test/speed3.test e312d7e442a5047d730569fdae2ba99bc94e1a13
F test/sqllimits1.test 2495508114bd84f6fc9ece34d5a7bb3dc69359bc F test/sqllimits1.test 3b08a538c9828041a5c1454293594d922602044d
F test/subquery.test 8203f85db56ba022a57a0589890090c8feed4e59 F test/subquery.test 8203f85db56ba022a57a0589890090c8feed4e59
F test/subselect.test 974e87f8fc91c5f00dd565316d396a5a6c3106c4 F test/subselect.test 974e87f8fc91c5f00dd565316d396a5a6c3106c4
F test/substr.test d36c864a238e1f51e7829af660906f05d47b5e32 F test/substr.test d36c864a238e1f51e7829af660906f05d47b5e32
F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3 F test/sync.test ded6b39d8d8ca3c0c5518516c6371b3316d3e3a3
F test/table.test dbdfd06aef054ad5aed8e57a782137d57d5c5528 F test/table.test 13b1c2e2fb4727b35ee1fb7641fc469214fd2455
F test/tableapi.test 92651a95c23cf955e92407928e640536402fa3cc F test/tableapi.test 92651a95c23cf955e92407928e640536402fa3cc
F test/tclsqlite.test c7feea1985c3e8a1ed134ba342347d47fa762e43 F test/tclsqlite.test c7feea1985c3e8a1ed134ba342347d47fa762e43
F test/temptable.test d9208644207cf205437907d994004f636309ccc7 F test/temptable.test 19b851b9e3e64d91e9867619b2a3f5fffee6e125
F test/tester.tcl 913a808f05b0aed2fbb16481a423b1a5a118bdf0 F test/tester.tcl 913a808f05b0aed2fbb16481a423b1a5a118bdf0
F test/thread001.test 8fbd9559da0bbdc273e00318c7fd66c162020af7 F test/thread001.test 8fbd9559da0bbdc273e00318c7fd66c162020af7
F test/thread002.test 1b886bc4cb396e2bba94be8996f159b2b5b605bc F test/thread002.test 2c4ad2c386f60f6fe268cd91c769ee35b3c1fd0b
F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35 F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35
F test/thread2.test 6d7b30102d600f51b4055ee3a5a19228799049fb F test/thread2.test 6d7b30102d600f51b4055ee3a5a19228799049fb
F test/thread_common.tcl 8a9d7a4500dfdbbd36679c977831b62c130b76b1 F test/thread_common.tcl 8a9d7a4500dfdbbd36679c977831b62c130b76b1
@ -448,7 +448,7 @@ F test/tkt1537.test e3a14332de9770be8ff14bd15c19a49cbec10808
F test/tkt1567.test 18023cc3626a365f0118e17b66decedec93b1a6f F test/tkt1567.test 18023cc3626a365f0118e17b66decedec93b1a6f
F test/tkt1644.test 80b6a2bb17885f3cf1cb886d97cdad13232bb869 F test/tkt1644.test 80b6a2bb17885f3cf1cb886d97cdad13232bb869
F test/tkt1667.test ef52c857940755ea5eab24d68f808826e7dcdc94 F test/tkt1667.test ef52c857940755ea5eab24d68f808826e7dcdc94
F test/tkt1873.test 7159a1c1bf627bbb03f11362e4ad4de11d6ff316 F test/tkt1873.test 255a002b9afdcf8b0fa3188984e2c964202340e9
F test/tkt2141.test f543d96f50d5a5dc0bc744f7db74ea166720ce46 F test/tkt2141.test f543d96f50d5a5dc0bc744f7db74ea166720ce46
F test/tkt2192.test d213199a51528feb2a0f80b5ee60d1e2abfd9679 F test/tkt2192.test d213199a51528feb2a0f80b5ee60d1e2abfd9679
F test/tkt2213.test 8cf7c446e1fcd0627fffe7fc19046eb24ac7333b F test/tkt2213.test 8cf7c446e1fcd0627fffe7fc19046eb24ac7333b
@ -464,7 +464,7 @@ F test/tkt2643.test 3f3ebb743da00d4fed4fcf6daed92a0e18e57813
F test/tkt2686.test 8815c3eeae7c8363bd7c2889349ec39e8bc8000d F test/tkt2686.test 8815c3eeae7c8363bd7c2889349ec39e8bc8000d
F test/trace.test 75ffc1b992c780d054748a656e3e7fd674f18567 F test/trace.test 75ffc1b992c780d054748a656e3e7fd674f18567
F test/trans.test b73289992b46d38d9479ecc4fdc03d8edb2413dc F test/trans.test b73289992b46d38d9479ecc4fdc03d8edb2413dc
F test/trigger1.test b361161cf20614024cc1e52ea0bdec250776b2ae F test/trigger1.test 7c13f39ca36f529bf856e05c7d004fc0531d48b4
F test/trigger2.test 33bf8ae9b788013be194efe5f66c04a202facbb4 F test/trigger2.test 33bf8ae9b788013be194efe5f66c04a202facbb4
F test/trigger3.test 9102fd3933db294dc654b5aee9edfe9e94f2b9e2 F test/trigger3.test 9102fd3933db294dc654b5aee9edfe9e94f2b9e2
F test/trigger4.test 8e90ee98cba940cd5f96493f82e55083806ab8a0 F test/trigger4.test 8e90ee98cba940cd5f96493f82e55083806ab8a0
@ -482,14 +482,14 @@ F test/utf16align.test 7360e84472095518c56746f76b1f9d4dce99fb4d
F test/vacuum.test cf839fc3ff24d601057319bbb5c700ce9c8e0fb0 F test/vacuum.test cf839fc3ff24d601057319bbb5c700ce9c8e0fb0
F test/vacuum2.test e198d81a1cbc3f3f6b8aeee27cadfffea8995d42 F test/vacuum2.test e198d81a1cbc3f3f6b8aeee27cadfffea8995d42
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/view.test 852bd4101e6d171c46ad682eb5c5faf662b2eba4 F test/view.test 7e15fa1ba3267ddaa9ae96b6daf519f23f95b43e
F test/vtab1.test 2f0afae624babc671af2052e88e98b4ac4aafd1e F test/vtab1.test 3271e7c5128f17a16fee795f273c4658da97c168
F test/vtab2.test 94bb3bf691ac10e34cf7dad46b1cf94b861d513c F test/vtab2.test 94bb3bf691ac10e34cf7dad46b1cf94b861d513c
F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587 F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587
F test/vtab4.test a9d7104d41a787754a734740d7aa61c807a69f87 F test/vtab4.test a9d7104d41a787754a734740d7aa61c807a69f87
F test/vtab5.test 26bc7a0a52c5c2bcfa849ba327f8a0d4abccdb23 F test/vtab5.test 26bc7a0a52c5c2bcfa849ba327f8a0d4abccdb23
F test/vtab6.test ec0036f29f8a803da9935206f2d9d1b6a8026392 F test/vtab6.test ec0036f29f8a803da9935206f2d9d1b6a8026392
F test/vtab7.test 5f9ef9fb84733e928d5d0267c821072561b198d5 F test/vtab7.test 9249e8e31f4f1a44f07984b402d12ce3e63be4f3
F test/vtab8.test e19fa4a538fcd1bb66c22825fa8f71618fb13583 F test/vtab8.test e19fa4a538fcd1bb66c22825fa8f71618fb13583
F test/vtab9.test ea58d2b95d61955f87226381716b2d0b1d4e4f9b F test/vtab9.test ea58d2b95d61955f87226381716b2d0b1d4e4f9b
F test/vtabA.test 9cb6b1afead6fdd91bbdf1ca65c44ccfd9b10936 F test/vtabA.test 9cb6b1afead6fdd91bbdf1ca65c44ccfd9b10936
@ -581,7 +581,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 27346fa55ed9b5c20016d07a37268fbd42dc097f P ccd709e1791b1c1091a61139633b972b378c1816
R 2ac64ff791413acc80640b875cdb23e3 R 6c6a7773faeda4091116a43ab452b402
U drh U danielk1977
Z 64719b764c78c200eccd02a7c4303411 Z a91cdcc7bf556827c74c0b09ee7b03b3

View File

@ -1 +1 @@
ccd709e1791b1c1091a61139633b972b378c1816 07c00fffe50e8380748f7ae02328531a75d64610

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this script is testing the ALTER TABLE statement. # focus of this script is testing the ALTER TABLE statement.
# #
# $Id: alter.test,v 1.25 2007/05/15 16:51:37 drh Exp $ # $Id: alter.test,v 1.26 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -203,50 +203,52 @@ do_test alter-1.7 {
# Check that ALTER TABLE works on attached databases. # Check that ALTER TABLE works on attached databases.
# #
do_test alter-1.8.1 { ifcapable attach {
file delete -force test2.db do_test alter-1.8.1 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
ATTACH 'test2.db' AS aux; execsql {
} ATTACH 'test2.db' AS aux;
} {} }
do_test alter-1.8.2 { } {}
execsql { do_test alter-1.8.2 {
CREATE TABLE t4(a PRIMARY KEY, b, c); execsql {
CREATE TABLE aux.t4(a PRIMARY KEY, b, c); CREATE TABLE t4(a PRIMARY KEY, b, c);
CREATE INDEX i4 ON t4(b); CREATE TABLE aux.t4(a PRIMARY KEY, b, c);
CREATE INDEX aux.i4 ON t4(b); CREATE INDEX i4 ON t4(b);
} CREATE INDEX aux.i4 ON t4(b);
} {} }
do_test alter-1.8.3 { } {}
execsql { do_test alter-1.8.3 {
INSERT INTO t4 VALUES('main', 'main', 'main'); execsql {
INSERT INTO aux.t4 VALUES('aux', 'aux', 'aux'); INSERT INTO t4 VALUES('main', 'main', 'main');
SELECT * FROM t4 WHERE a = 'main'; INSERT INTO aux.t4 VALUES('aux', 'aux', 'aux');
} SELECT * FROM t4 WHERE a = 'main';
} {main main main} }
do_test alter-1.8.4 { } {main main main}
execsql { do_test alter-1.8.4 {
ALTER TABLE t4 RENAME TO t5; execsql {
SELECT * FROM t4 WHERE a = 'aux'; ALTER TABLE t4 RENAME TO t5;
} SELECT * FROM t4 WHERE a = 'aux';
} {aux aux aux} }
do_test alter-1.8.5 { } {aux aux aux}
execsql { do_test alter-1.8.5 {
SELECT * FROM t5; execsql {
} SELECT * FROM t5;
} {main main main} }
do_test alter-1.8.6 { } {main main main}
execsql { do_test alter-1.8.6 {
SELECT * FROM t5 WHERE b = 'main'; execsql {
} SELECT * FROM t5 WHERE b = 'main';
} {main main main} }
do_test alter-1.8.7 { } {main main main}
execsql { do_test alter-1.8.7 {
ALTER TABLE aux.t4 RENAME TO t5; execsql {
SELECT * FROM aux.t5 WHERE b = 'aux'; ALTER TABLE aux.t4 RENAME TO t5;
} SELECT * FROM aux.t5 WHERE b = 'aux';
} {aux aux aux} }
} {aux aux aux}
}
do_test alter-1.9.1 { do_test alter-1.9.1 {
execsql { execsql {
@ -396,36 +398,38 @@ do_test alter-3.1.8 {
# quoting. Otherwise the sqlite_alter_trigger() function might not work. # quoting. Otherwise the sqlite_alter_trigger() function might not work.
file delete -force test3.db file delete -force test3.db
file delete -force test3.db-journal file delete -force test3.db-journal
do_test alter-3.2.1 { ifcapable attach {
catchsql { do_test alter-3.2.1 {
ATTACH 'test3.db' AS ON; catchsql {
} ATTACH 'test3.db' AS ON;
} {1 {near "ON": syntax error}} }
do_test alter-3.2.2 { } {1 {near "ON": syntax error}}
catchsql { do_test alter-3.2.2 {
ATTACH 'test3.db' AS 'ON'; catchsql {
} ATTACH 'test3.db' AS 'ON';
} {0 {}} }
do_test alter-3.2.3 { } {0 {}}
catchsql { do_test alter-3.2.3 {
CREATE TABLE ON.t1(a, b, c); catchsql {
} CREATE TABLE ON.t1(a, b, c);
} {1 {near "ON": syntax error}} }
do_test alter-3.2.4 { } {1 {near "ON": syntax error}}
catchsql { do_test alter-3.2.4 {
CREATE TABLE 'ON'.t1(a, b, c); catchsql {
} CREATE TABLE 'ON'.t1(a, b, c);
} {0 {}} }
do_test alter-3.2.4 { } {0 {}}
catchsql { do_test alter-3.2.4 {
CREATE TABLE 'ON'.ON(a, b, c); catchsql {
} CREATE TABLE 'ON'.ON(a, b, c);
} {1 {near "ON": syntax error}} }
do_test alter-3.2.5 { } {1 {near "ON": syntax error}}
catchsql { do_test alter-3.2.5 {
CREATE TABLE 'ON'.'ON'(a, b, c); catchsql {
} CREATE TABLE 'ON'.'ON'(a, b, c);
} {0 {}} }
} {0 {}}
}
do_test alter-3.2.6 { do_test alter-3.2.6 {
catchsql { catchsql {
CREATE TABLE t10(a, ON, c); CREATE TABLE t10(a, ON, c);
@ -441,11 +445,13 @@ do_test alter-3.2.8 {
CREATE TRIGGER trig4 AFTER INSERT ON ON BEGIN SELECT 1; END; CREATE TRIGGER trig4 AFTER INSERT ON ON BEGIN SELECT 1; END;
} }
} {1 {near "ON": syntax error}} } {1 {near "ON": syntax error}}
do_test alter-3.2.9 { ifcapable attach {
catchsql { do_test alter-3.2.9 {
CREATE TRIGGER 'on'.trig4 AFTER INSERT ON 'ON' BEGIN SELECT 1; END; catchsql {
} CREATE TRIGGER 'on'.trig4 AFTER INSERT ON 'ON' BEGIN SELECT 1; END;
} {0 {}} }
} {0 {}}
}
do_test alter-3.2.10 { do_test alter-3.2.10 {
execsql { execsql {
DROP TABLE t10; DROP TABLE t10;

View File

@ -13,7 +13,7 @@
# file format change that may be used in the future to implement # file format change that may be used in the future to implement
# "ALTER TABLE ... ADD COLUMN". # "ALTER TABLE ... ADD COLUMN".
# #
# $Id: alter2.test,v 1.9 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: alter2.test,v 1.10 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -287,15 +287,17 @@ do_test alter2-6.1 {
set ::DB [sqlite3_connection_pointer db] set ::DB [sqlite3_connection_pointer db]
get_file_format get_file_format
} {2} } {2}
do_test alter2-6.2 { ifcapable attach {
file delete -force test2.db-journal do_test alter2-6.2 {
file delete -force test2.db file delete -force test2.db-journal
execsql { file delete -force test2.db
ATTACH 'test2.db' AS aux; execsql {
CREATE TABLE aux.t1(a, b); ATTACH 'test2.db' AS aux;
} CREATE TABLE aux.t1(a, b);
get_file_format test2.db }
} $default_file_format get_file_format test2.db
} $default_file_format
}
do_test alter2-6.3 { do_test alter2-6.3 {
execsql { execsql {
CREATE TABLE t1(a, b); CREATE TABLE t1(a, b);

View File

@ -13,7 +13,7 @@
# file format change that may be used in the future to implement # file format change that may be used in the future to implement
# "ALTER TABLE ... ADD COLUMN". # "ALTER TABLE ... ADD COLUMN".
# #
# $Id: alter3.test,v 1.9 2006/01/17 09:35:02 danielk1977 Exp $ # $Id: alter3.test,v 1.10 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -236,71 +236,73 @@ do_test alter3-4.99 {
} }
} {} } {}
do_test alter3-5.1 { ifcapable attach {
file delete -force test2.db do_test alter3-5.1 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 'one');
INSERT INTO t1 VALUES(2, 'two');
ATTACH 'test2.db' AS aux;
CREATE TABLE aux.t1 AS SELECT * FROM t1;
PRAGMA aux.schema_version = 30;
SELECT sql FROM aux.sqlite_master;
}
} {{CREATE TABLE t1(a,b)}}
do_test alter3-5.2 {
execsql {
ALTER TABLE aux.t1 ADD COLUMN c VARCHAR(128);
SELECT sql FROM aux.sqlite_master;
}
} {{CREATE TABLE t1(a,b, c VARCHAR(128))}}
do_test alter3-5.3 {
execsql {
SELECT * FROM aux.t1;
}
} {1 one {} 2 two {}}
ifcapable schema_version {
do_test alter3-5.4 {
execsql { execsql {
PRAGMA aux.schema_version; CREATE TABLE t1(a, b);
} INSERT INTO t1 VALUES(1, 'one');
} {31} INSERT INTO t1 VALUES(2, 'two');
} ATTACH 'test2.db' AS aux;
if {!$has_codec} { CREATE TABLE aux.t1 AS SELECT * FROM t1;
do_test alter3-5.5 { PRAGMA aux.schema_version = 30;
list [get_file_format test2.db] [get_file_format] SELECT sql FROM aux.sqlite_master;
} {2 3} }
} } {{CREATE TABLE t1(a,b)}}
do_test alter3-5.6 { do_test alter3-5.2 {
execsql {
ALTER TABLE aux.t1 ADD COLUMN d DEFAULT 1000;
SELECT sql FROM aux.sqlite_master;
}
} {{CREATE TABLE t1(a,b, c VARCHAR(128), d DEFAULT 1000)}}
do_test alter3-5.7 {
execsql {
SELECT * FROM aux.t1;
}
} {1 one {} 1000 2 two {} 1000}
ifcapable schema_version {
do_test alter3-5.8 {
execsql { execsql {
PRAGMA aux.schema_version; ALTER TABLE aux.t1 ADD COLUMN c VARCHAR(128);
SELECT sql FROM aux.sqlite_master;
} }
} {32} } {{CREATE TABLE t1(a,b, c VARCHAR(128))}}
do_test alter3-5.3 {
execsql {
SELECT * FROM aux.t1;
}
} {1 one {} 2 two {}}
ifcapable schema_version {
do_test alter3-5.4 {
execsql {
PRAGMA aux.schema_version;
}
} {31}
}
if {!$has_codec} {
do_test alter3-5.5 {
list [get_file_format test2.db] [get_file_format]
} {2 3}
}
do_test alter3-5.6 {
execsql {
ALTER TABLE aux.t1 ADD COLUMN d DEFAULT 1000;
SELECT sql FROM aux.sqlite_master;
}
} {{CREATE TABLE t1(a,b, c VARCHAR(128), d DEFAULT 1000)}}
do_test alter3-5.7 {
execsql {
SELECT * FROM aux.t1;
}
} {1 one {} 1000 2 two {} 1000}
ifcapable schema_version {
do_test alter3-5.8 {
execsql {
PRAGMA aux.schema_version;
}
} {32}
}
do_test alter3-5.9 {
execsql {
SELECT * FROM t1;
}
} {1 one 2 two}
do_test alter3-5.99 {
execsql {
DROP TABLE aux.t1;
DROP TABLE t1;
}
} {}
} }
do_test alter3-5.9 {
execsql {
SELECT * FROM t1;
}
} {1 one 2 two}
do_test alter3-5.99 {
execsql {
DROP TABLE aux.t1;
DROP TABLE t1;
}
} {}
#---------------------------------------------------------------- #----------------------------------------------------------------
# Test that the table schema is correctly reloaded when a column # Test that the table schema is correctly reloaded when a column

View File

@ -12,12 +12,17 @@
# focus of this script is testing the ATTACH and DETACH commands # focus of this script is testing the ATTACH and DETACH commands
# and related functionality. # and related functionality.
# #
# $Id: attach.test,v 1.46 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: attach.test,v 1.47 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !attach {
finish_test
return
}
for {set i 2} {$i<=15} {incr i} { for {set i 2} {$i<=15} {incr i} {
file delete -force test$i.db file delete -force test$i.db
file delete -force test$i.db-journal file delete -force test$i.db-journal

View File

@ -12,12 +12,17 @@
# focus of this script is testing the ATTACH and DETACH commands # focus of this script is testing the ATTACH and DETACH commands
# and related functionality. # and related functionality.
# #
# $Id: attach2.test,v 1.36 2007/08/10 19:46:14 drh Exp $ # $Id: attach2.test,v 1.37 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !attach {
finish_test
return
}
# Ticket #354 # Ticket #354
# #
# Databases test.db and test2.db contain identical schemas. Make # Databases test.db and test2.db contain identical schemas. Make

View File

@ -12,13 +12,17 @@
# focus of this script is testing the ATTACH and DETACH commands # focus of this script is testing the ATTACH and DETACH commands
# and schema changes to attached databases. # and schema changes to attached databases.
# #
# $Id: attach3.test,v 1.17 2006/06/20 11:01:09 danielk1977 Exp $ # $Id: attach3.test,v 1.18 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !attach {
finish_test
return
}
# Create tables t1 and t2 in the main database # Create tables t1 and t2 in the main database
execsql { execsql {
CREATE TABLE t1(a, b); CREATE TABLE t1(a, b);

View File

@ -12,13 +12,13 @@
# focus of this script is testing the ATTACH statement and # focus of this script is testing the ATTACH statement and
# specifically out-of-memory conditions within that command. # specifically out-of-memory conditions within that command.
# #
# $Id: attachmalloc.test,v 1.6 2007/10/03 08:46:45 danielk1977 Exp $ # $Id: attachmalloc.test,v 1.7 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !memdebug { ifcapable !memdebug||!attach {
finish_test finish_test
return return
} }

View File

@ -12,7 +12,7 @@
# focus of this script is testing the sqlite3_set_authorizer() API # focus of this script is testing the sqlite3_set_authorizer() API
# and related functionality. # and related functionality.
# #
# $Id: auth.test,v 1.37 2006/08/24 14:59:46 drh Exp $ # $Id: auth.test,v 1.38 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -305,11 +305,13 @@ do_test auth-1.35.1 {
} }
catchsql {SELECT * FROM t2} catchsql {SELECT * FROM t2}
} {1 {access to t2.b is prohibited}} } {1 {access to t2.b is prohibited}}
do_test auth-1.35.2 { ifcapable attach {
execsql {ATTACH DATABASE 'test.db' AS two} do_test auth-1.35.2 {
catchsql {SELECT * FROM two.t2} execsql {ATTACH DATABASE 'test.db' AS two}
} {1 {access to two.t2.b is prohibited}} catchsql {SELECT * FROM two.t2}
execsql {DETACH DATABASE two} } {1 {access to two.t2.b is prohibited}}
execsql {DETACH DATABASE two}
}
do_test auth-1.36 { do_test auth-1.36 {
proc auth {code arg1 arg2 arg3 arg4} { proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_READ" && $arg1=="t2" && $arg2=="b"} { if {$code=="SQLITE_READ" && $arg1=="t2" && $arg2=="b"} {
@ -1610,174 +1612,176 @@ do_test auth-1.250 {
# ticket #340 - authorization for ATTACH and DETACH. # ticket #340 - authorization for ATTACH and DETACH.
# #
do_test auth-1.251 { ifcapable attach {
db authorizer ::auth do_test auth-1.251 {
proc auth {code arg1 arg2 arg3 arg4} { db authorizer ::auth
if {$code=="SQLITE_ATTACH"} { proc auth {code arg1 arg2 arg3 arg4} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4] if {$code=="SQLITE_ATTACH"} {
} set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_OK }
}
catchsql {
ATTACH DATABASE ':memory:' AS test1
}
} {0 {}}
do_test auth-1.252 {
set ::authargs
} {:memory: {} {} {}}
do_test auth-1.253 {
catchsql {DETACH DATABASE test1}
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ATTACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_DENY
}
return SQLITE_OK
}
catchsql {
ATTACH DATABASE ':memory:' AS test1;
}
} {1 {not authorized}}
do_test auth-1.254 {
lindex [execsql {PRAGMA database_list}] 7
} {}
do_test auth-1.255 {
catchsql {DETACH DATABASE test1}
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ATTACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_IGNORE
}
return SQLITE_OK
}
catchsql {
ATTACH DATABASE ':memory:' AS test1;
}
} {0 {}}
do_test auth-1.256 {
lindex [execsql {PRAGMA database_list}] 7
} {}
do_test auth-1.257 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_DETACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_OK return SQLITE_OK
} }
return SQLITE_OK catchsql {
} ATTACH DATABASE ':memory:' AS test1
execsql {ATTACH DATABASE ':memory:' AS test1}
catchsql {
DETACH DATABASE test1;
}
} {0 {}}
do_test auth-1.258 {
lindex [execsql {PRAGMA database_list}] 7
} {}
do_test auth-1.259 {
execsql {ATTACH DATABASE ':memory:' AS test1}
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_DETACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_IGNORE
} }
return SQLITE_OK } {0 {}}
} do_test auth-1.252 {
catchsql { set ::authargs
DETACH DATABASE test1; } {:memory: {} {} {}}
} do_test auth-1.253 {
} {0 {}} catchsql {DETACH DATABASE test1}
ifcapable tempdb {
ifcapable schema_pragmas {
do_test auth-1.260 {
lindex [execsql {PRAGMA database_list}] 7
} {test1}
} ;# ifcapable schema_pragmas
do_test auth-1.261 {
proc auth {code arg1 arg2 arg3 arg4} { proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_DETACH"} { if {$code=="SQLITE_ATTACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4] set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_DENY return SQLITE_DENY
} }
return SQLITE_OK return SQLITE_OK
} }
catchsql { catchsql {
DETACH DATABASE test1; ATTACH DATABASE ':memory:' AS test1;
} }
} {1 {not authorized}} } {1 {not authorized}}
ifcapable schema_pragmas { do_test auth-1.254 {
do_test auth-1.262 {
lindex [execsql {PRAGMA database_list}] 7 lindex [execsql {PRAGMA database_list}] 7
} {test1} } {}
} ;# ifcapable schema_pragmas do_test auth-1.255 {
db authorizer {} catchsql {DETACH DATABASE test1}
execsql {DETACH DATABASE test1} proc auth {code arg1 arg2 arg3 arg4} {
db authorizer ::auth if {$code=="SQLITE_ATTACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
# Authorization for ALTER TABLE. These tests are omitted if the library return SQLITE_IGNORE
# was built without ALTER TABLE support. }
ifcapable altertable { return SQLITE_OK
}
do_test auth-1.263 { catchsql {
proc auth {code arg1 arg2 arg3 arg4} { ATTACH DATABASE ':memory:' AS test1;
if {$code=="SQLITE_ALTER_TABLE"} { }
set ::authargs [list $arg1 $arg2 $arg3 $arg4] } {0 {}}
return SQLITE_OK do_test auth-1.256 {
} lindex [execsql {PRAGMA database_list}] 7
} {}
do_test auth-1.257 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_DETACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_OK return SQLITE_OK
} }
catchsql { return SQLITE_OK
ALTER TABLE t1 RENAME TO t1x }
execsql {ATTACH DATABASE ':memory:' AS test1}
catchsql {
DETACH DATABASE test1;
}
} {0 {}}
do_test auth-1.258 {
lindex [execsql {PRAGMA database_list}] 7
} {}
do_test auth-1.259 {
execsql {ATTACH DATABASE ':memory:' AS test1}
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_DETACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_IGNORE
} }
} {0 {}} return SQLITE_OK
do_test auth-1.264 { }
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'} catchsql {
} {t1x} DETACH DATABASE test1;
do_test auth-1.265 { }
set authargs } {0 {}}
} {temp t1 {} {}} ifcapable tempdb {
do_test auth-1.266 { ifcapable schema_pragmas {
do_test auth-1.260 {
lindex [execsql {PRAGMA database_list}] 7
} {test1}
} ;# ifcapable schema_pragmas
do_test auth-1.261 {
proc auth {code arg1 arg2 arg3 arg4} { proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ALTER_TABLE"} { if {$code=="SQLITE_DETACH"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_IGNORE
}
return SQLITE_OK
}
catchsql {
ALTER TABLE t1x RENAME TO t1
}
} {0 {}}
do_test auth-1.267 {
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'}
} {t1x}
do_test auth-1.268 {
set authargs
} {temp t1x {} {}}
do_test auth-1.269 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ALTER_TABLE"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4] set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_DENY return SQLITE_DENY
} }
return SQLITE_OK return SQLITE_OK
} }
catchsql { catchsql {
ALTER TABLE t1x RENAME TO t1 DETACH DATABASE test1;
} }
} {1 {not authorized}} } {1 {not authorized}}
do_test auth-1.270 { ifcapable schema_pragmas {
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'} do_test auth-1.262 {
} {t1x} lindex [execsql {PRAGMA database_list}] 7
} {test1}
do_test auth-1.271 { } ;# ifcapable schema_pragmas
set authargs db authorizer {}
} {temp t1x {} {}} execsql {DETACH DATABASE test1}
} ;# ifcapable altertable db authorizer ::auth
} else { # Authorization for ALTER TABLE. These tests are omitted if the library
db authorizer {} # was built without ALTER TABLE support.
db eval { ifcapable altertable {
DETACH DATABASE test1;
do_test auth-1.263 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ALTER_TABLE"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_OK
}
return SQLITE_OK
}
catchsql {
ALTER TABLE t1 RENAME TO t1x
}
} {0 {}}
do_test auth-1.264 {
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'}
} {t1x}
do_test auth-1.265 {
set authargs
} {temp t1 {} {}}
do_test auth-1.266 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ALTER_TABLE"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_IGNORE
}
return SQLITE_OK
}
catchsql {
ALTER TABLE t1x RENAME TO t1
}
} {0 {}}
do_test auth-1.267 {
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'}
} {t1x}
do_test auth-1.268 {
set authargs
} {temp t1x {} {}}
do_test auth-1.269 {
proc auth {code arg1 arg2 arg3 arg4} {
if {$code=="SQLITE_ALTER_TABLE"} {
set ::authargs [list $arg1 $arg2 $arg3 $arg4]
return SQLITE_DENY
}
return SQLITE_OK
}
catchsql {
ALTER TABLE t1x RENAME TO t1
}
} {1 {not authorized}}
do_test auth-1.270 {
execsql {SELECT name FROM sqlite_temp_master WHERE type='table'}
} {t1x}
do_test auth-1.271 {
set authargs
} {temp t1x {} {}}
} ;# ifcapable altertable
} else {
db authorizer {}
db eval {
DETACH DATABASE test1;
}
} }
} }

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this script is testing the AUTOINCREMENT features. # focus of this script is testing the AUTOINCREMENT features.
# #
# $Id: autoinc.test,v 1.9 2006/01/03 00:33:50 drh Exp $ # $Id: autoinc.test,v 1.10 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -416,7 +416,7 @@ ifcapable tempdb {
# Make sure AUTOINCREMENT works on ATTACH-ed tables. # Make sure AUTOINCREMENT works on ATTACH-ed tables.
# #
ifcapable tempdb { ifcapable tempdb&&attach {
do_test autoinc-5.1 { do_test autoinc-5.1 {
file delete -force test2.db file delete -force test2.db
file delete -force test2.db-journal file delete -force test2.db-journal

View File

@ -17,7 +17,7 @@
# These routines allow us to simulate the kind of file damage that # These routines allow us to simulate the kind of file damage that
# occurs after a power failure. # occurs after a power failure.
# #
# $Id: crash.test,v 1.25 2007/08/20 14:23:44 danielk1977 Exp $ # $Id: crash.test,v 1.26 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -209,98 +209,100 @@ for {set i 1} {$i < $repeats} {incr i} {
# crash-4.3.*: Test recovery when crash occurs during sync() of the master # crash-4.3.*: Test recovery when crash occurs during sync() of the master
# journal file. # journal file.
# #
do_test crash-4.0 { ifcapable attach {
file delete -force test2.db do_test crash-4.0 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
ATTACH 'test2.db' AS aux; execsql {
PRAGMA aux.default_cache_size = 10; ATTACH 'test2.db' AS aux;
CREATE TABLE aux.abc2 AS SELECT 2*a as a, 2*b as b, 2*c as c FROM abc; PRAGMA aux.default_cache_size = 10;
CREATE TABLE aux.abc2 AS SELECT 2*a as a, 2*b as b, 2*c as c FROM abc;
}
expr ([file size test2.db] / 1024) > 450
} {1}
set fin 0
for {set i 1} {$i<$repeats} {incr i} {
set sig [signature]
set sig2 [signature2]
do_test crash-4.1.$i.1 {
set c [crashsql -delay $i -file test.db-journal "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT randstr($i,$i) FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"]
if { $c == {0 {}} } {
set ::fin 1
set c {1 {child process exited abnormally}}
}
set c
} {1 {child process exited abnormally}}
if {$::fin} break
do_test crash-4.1.$i.2 {
signature
} $sig
do_test crash-4.1.$i.3 {
signature2
} $sig2
}
set i 0
set fin 0
while {[incr i]} {
set sig [signature]
set sig2 [signature2]
set ::fin 0
do_test crash-4.2.$i.1 {
set c [crashsql -delay $i -file test2.db-journal "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT randstr($i,$i) FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"]
if { $c == {0 {}} } {
set ::fin 1
set c {1 {child process exited abnormally}}
}
set c
} {1 {child process exited abnormally}}
if { $::fin } break
do_test crash-4.2.$i.2 {
signature
} $sig
do_test crash-4.2.$i.3 {
signature2
} $sig2
}
for {set i 1} {$i < 5} {incr i} {
set sig [signature]
set sig2 [signature2]
do_test crash-4.3.$i.1 {
crashsql -delay 1 -file test.db-mj* "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT random() FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"
} {1 {child process exited abnormally}}
do_test crash-4.3.$i.2 {
signature
} $sig
do_test crash-4.3.$i.3 {
signature2
} $sig2
} }
expr ([file size test2.db] / 1024) > 450
} {1}
set fin 0
for {set i 1} {$i<$repeats} {incr i} {
set sig [signature]
set sig2 [signature2]
do_test crash-4.1.$i.1 {
set c [crashsql -delay $i -file test.db-journal "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT randstr($i,$i) FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"]
if { $c == {0 {}} } {
set ::fin 1
set c {1 {child process exited abnormally}}
}
set c
} {1 {child process exited abnormally}}
if {$::fin} break
do_test crash-4.1.$i.2 {
signature
} $sig
do_test crash-4.1.$i.3 {
signature2
} $sig2
}
set i 0
set fin 0
while {[incr i]} {
set sig [signature]
set sig2 [signature2]
set ::fin 0
do_test crash-4.2.$i.1 {
set c [crashsql -delay $i -file test2.db-journal "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT randstr($i,$i) FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"]
if { $c == {0 {}} } {
set ::fin 1
set c {1 {child process exited abnormally}}
}
set c
} {1 {child process exited abnormally}}
if { $::fin } break
do_test crash-4.2.$i.2 {
signature
} $sig
do_test crash-4.2.$i.3 {
signature2
} $sig2
}
for {set i 1} {$i < 5} {incr i} {
set sig [signature]
set sig2 [signature2]
do_test crash-4.3.$i.1 {
crashsql -delay 1 -file test.db-mj* "
ATTACH 'test2.db' AS aux;
BEGIN;
SELECT random() FROM abc LIMIT $i;
INSERT INTO abc VALUES(randstr(10,10), 0, 0);
DELETE FROM abc WHERE random()%10!=0;
INSERT INTO abc2 VALUES(randstr(10,10), 0, 0);
DELETE FROM abc2 WHERE random()%10!=0;
COMMIT;
"
} {1 {child process exited abnormally}}
do_test crash-4.3.$i.2 {
signature
} $sig
do_test crash-4.3.$i.3 {
signature2
} $sig2
} }
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------

View File

@ -13,7 +13,7 @@
# various suported unicode encodings (UTF-8, UTF-16, UTF-16le and # various suported unicode encodings (UTF-8, UTF-16, UTF-16le and
# UTF-16be). # UTF-16be).
# #
# $Id: enc2.test,v 1.28 2006/09/23 20:36:03 drh Exp $ # $Id: enc2.test,v 1.29 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -170,26 +170,27 @@ foreach enc $encodings {
# Test that it is an error to try to attach a database with a different # Test that it is an error to try to attach a database with a different
# encoding to the main database. # encoding to the main database.
do_test enc2-4.1 { ifcapable attach {
file delete -force test.db do_test enc2-4.1 {
sqlite3 db test.db file delete -force test.db
db eval "PRAGMA encoding = 'UTF-8'" sqlite3 db test.db
db eval "CREATE TABLE abc(a, b, c);" db eval "PRAGMA encoding = 'UTF-8'"
} {} db eval "CREATE TABLE abc(a, b, c);"
do_test enc2-4.2 { } {}
file delete -force test2.db do_test enc2-4.2 {
sqlite3 db2 test2.db file delete -force test2.db
db2 eval "PRAGMA encoding = 'UTF-16'" sqlite3 db2 test2.db
db2 eval "CREATE TABLE abc(a, b, c);" db2 eval "PRAGMA encoding = 'UTF-16'"
} {} db2 eval "CREATE TABLE abc(a, b, c);"
do_test enc2-4.3 { } {}
catchsql { do_test enc2-4.3 {
ATTACH 'test2.db' as aux; catchsql {
} ATTACH 'test2.db' as aux;
} {1 {attached databases must use the same text encoding as main database}} }
} {1 {attached databases must use the same text encoding as main database}}
db2 close db2 close
db close db close
}
# The following tests - enc2-5.* - test that SQLite selects the correct # The following tests - enc2-5.* - test that SQLite selects the correct
# collation sequence when more than one is available. # collation sequence when more than one is available.

View File

@ -12,7 +12,7 @@
# of these tests is exclusive access mode (i.e. the thing activated by # of these tests is exclusive access mode (i.e. the thing activated by
# "PRAGMA locking_mode = EXCLUSIVE"). # "PRAGMA locking_mode = EXCLUSIVE").
# #
# $Id: exclusive.test,v 1.6 2007/08/12 20:07:59 drh Exp $ # $Id: exclusive.test,v 1.7 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -84,82 +84,84 @@ do_test exclusive-1.6 {
pragma temp.locking_mode; pragma temp.locking_mode;
} }
} [list normal normal $temp_mode] } [list normal normal $temp_mode]
do_test exclusive-1.7 { ifcapable attach {
execsql { do_test exclusive-1.7 {
pragma locking_mode = exclusive; execsql {
ATTACH 'test2.db' as aux; pragma locking_mode = exclusive;
} ATTACH 'test2.db' as aux;
execsql { }
pragma main.locking_mode; execsql {
pragma aux.locking_mode; pragma main.locking_mode;
} pragma aux.locking_mode;
} {exclusive exclusive} }
do_test exclusive-1.8 { } {exclusive exclusive}
execsql { do_test exclusive-1.8 {
pragma main.locking_mode = normal; execsql {
} pragma main.locking_mode = normal;
execsql { }
pragma main.locking_mode; execsql {
pragma temp.locking_mode; pragma main.locking_mode;
pragma aux.locking_mode; pragma temp.locking_mode;
} pragma aux.locking_mode;
} [list normal $temp_mode exclusive] }
do_test exclusive-1.9 { } [list normal $temp_mode exclusive]
execsql { do_test exclusive-1.9 {
pragma locking_mode; execsql {
} pragma locking_mode;
} {exclusive} }
do_test exclusive-1.10 { } {exclusive}
execsql { do_test exclusive-1.10 {
ATTACH 'test3.db' as aux2; execsql {
} ATTACH 'test3.db' as aux2;
execsql { }
pragma main.locking_mode; execsql {
pragma aux.locking_mode; pragma main.locking_mode;
pragma aux2.locking_mode; pragma aux.locking_mode;
} pragma aux2.locking_mode;
} {normal exclusive exclusive} }
do_test exclusive-1.11 { } {normal exclusive exclusive}
execsql { do_test exclusive-1.11 {
pragma aux.locking_mode = normal; execsql {
} pragma aux.locking_mode = normal;
execsql { }
pragma main.locking_mode; execsql {
pragma aux.locking_mode; pragma main.locking_mode;
pragma aux2.locking_mode; pragma aux.locking_mode;
} pragma aux2.locking_mode;
} {normal normal exclusive} }
do_test exclusive-1.12 { } {normal normal exclusive}
execsql { do_test exclusive-1.12 {
pragma locking_mode = normal; execsql {
} pragma locking_mode = normal;
execsql { }
pragma main.locking_mode; execsql {
pragma temp.locking_mode; pragma main.locking_mode;
pragma aux.locking_mode; pragma temp.locking_mode;
pragma aux2.locking_mode; pragma aux.locking_mode;
} pragma aux2.locking_mode;
} [list normal $temp_mode normal normal] }
do_test exclusive-1.13 { } [list normal $temp_mode normal normal]
execsql { do_test exclusive-1.13 {
ATTACH 'test4.db' as aux3; execsql {
} ATTACH 'test4.db' as aux3;
execsql { }
pragma main.locking_mode; execsql {
pragma temp.locking_mode; pragma main.locking_mode;
pragma aux.locking_mode; pragma temp.locking_mode;
pragma aux2.locking_mode; pragma aux.locking_mode;
pragma aux3.locking_mode; pragma aux2.locking_mode;
} pragma aux3.locking_mode;
} [list normal $temp_mode normal normal normal] }
} [list normal $temp_mode normal normal normal]
do_test exclusive-1.99 {
execsql { do_test exclusive-1.99 {
DETACH aux; execsql {
DETACH aux2; DETACH aux;
DETACH aux3; DETACH aux2;
} DETACH aux3;
} {} }
} {}
}
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Test cases exclusive-2.X verify that connections in exclusive # Test cases exclusive-2.X verify that connections in exclusive

View File

@ -17,7 +17,7 @@
# sqlite_update_hook (tests hook-4-*) # sqlite_update_hook (tests hook-4-*)
# sqlite_rollback_hook (tests hook-5.*) # sqlite_rollback_hook (tests hook-5.*)
# #
# $Id: hook.test,v 1.11 2006/01/17 09:35:02 danielk1977 Exp $ # $Id: hook.test,v 1.12 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -177,23 +177,25 @@ ifcapable trigger {
# Update-hook + ATTACH # Update-hook + ATTACH
set ::update_hook {} set ::update_hook {}
do_test hook-4.2.3 { ifcapable attach {
file delete -force test2.db do_test hook-4.2.3 {
execsql { file delete -force test2.db
ATTACH 'test2.db' AS aux; execsql {
CREATE TABLE aux.t3(a INTEGER PRIMARY KEY, b); ATTACH 'test2.db' AS aux;
INSERT INTO aux.t3 SELECT * FROM t1; CREATE TABLE aux.t3(a INTEGER PRIMARY KEY, b);
UPDATE t3 SET b = 'two or so' WHERE a = 2; INSERT INTO aux.t3 SELECT * FROM t1;
DELETE FROM t3 WHERE 1; -- Avoid the truncate optimization (for now) UPDATE t3 SET b = 'two or so' WHERE a = 2;
} DELETE FROM t3 WHERE 1; -- Avoid the truncate optimization (for now)
set ::update_hook }
} [list \ set ::update_hook
INSERT aux t3 1 \ } [list \
INSERT aux t3 2 \ INSERT aux t3 1 \
UPDATE aux t3 2 \ INSERT aux t3 2 \
DELETE aux t3 1 \ UPDATE aux t3 2 \
DELETE aux t3 2 \ DELETE aux t3 1 \
] DELETE aux t3 2 \
]
}
ifcapable trigger { ifcapable trigger {
execsql { execsql {
@ -221,7 +223,7 @@ do_test hook-4.3.1 {
DELETE main t1 3 \ DELETE main t1 3 \
] ]
set ::update_hook {} set ::update_hook {}
ifcapable compound { ifcapable compound&&attach {
do_test hook-4.3.2 { do_test hook-4.3.2 {
execsql { execsql {
SELECT * FROM t1 UNION SELECT * FROM t3; SELECT * FROM t1 UNION SELECT * FROM t3;

View File

@ -9,7 +9,7 @@
# #
#*********************************************************************** #***********************************************************************
# #
# $Id: incrblob.test,v 1.16 2007/09/03 16:45:36 drh Exp $ # $Id: incrblob.test,v 1.17 2007/10/09 08:29:32 danielk1977 Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -341,35 +341,37 @@ do_test incrblob-4.11 {
# #
# Test that opening a blob in an attached database works. # Test that opening a blob in an attached database works.
# #
do_test incrblob-5.1 { ifcapable attach {
file delete -force test2.db test2.db-journal do_test incrblob-5.1 {
set ::size [expr [file size [info script]]] file delete -force test2.db test2.db-journal
execsql { set ::size [expr [file size [info script]]]
ATTACH 'test2.db' AS aux; execsql {
CREATE TABLE aux.files(name, text); ATTACH 'test2.db' AS aux;
INSERT INTO aux.files VALUES('this one', zeroblob($::size)); CREATE TABLE aux.files(name, text);
} INSERT INTO aux.files VALUES('this one', zeroblob($::size));
set fd [db incrblob aux files text 1] }
fconfigure $fd -translation binary set fd [db incrblob aux files text 1]
set fd2 [open [info script]] fconfigure $fd -translation binary
fconfigure $fd2 -translation binary set fd2 [open [info script]]
puts -nonewline $fd [read $fd2] fconfigure $fd2 -translation binary
close $fd puts -nonewline $fd [read $fd2]
close $fd2 close $fd
set ::text [db one {select text from aux.files}] close $fd2
string length $::text set ::text [db one {select text from aux.files}]
} [file size [info script]] string length $::text
do_test incrblob-5.2 { } [file size [info script]]
set fd2 [open [info script]] do_test incrblob-5.2 {
fconfigure $fd2 -translation binary set fd2 [open [info script]]
set ::data [read $fd2] fconfigure $fd2 -translation binary
close $fd2 set ::data [read $fd2]
set ::data close $fd2
} $::text set ::data
} $::text
}
# free memory # free memory
unset ::data unset -nocomplain ::data
unset ::text unset -nocomplain ::text
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# incrblob-6.*: # incrblob-6.*:

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the incremental vacuum feature. # focus of this file is testing the incremental vacuum feature.
# #
# $Id: incrvacuum2.test,v 1.3 2007/05/17 06:44:28 danielk1977 Exp $ # $Id: incrvacuum2.test,v 1.4 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -76,49 +76,51 @@ do_test incrvacuum2-1.4 {
# Make sure incremental vacuum works on attached databases. # Make sure incremental vacuum works on attached databases.
# #
do_test incrvacuum2-2.1 { ifcapable attach {
file delete -force test2.db test2.db-journal do_test incrvacuum2-2.1 {
execsql { file delete -force test2.db test2.db-journal
ATTACH DATABASE 'test2.db' AS aux; execsql {
PRAGMA aux.auto_vacuum=incremental; ATTACH DATABASE 'test2.db' AS aux;
CREATE TABLE aux.t2(x); PRAGMA aux.auto_vacuum=incremental;
INSERT INTO t2 VALUES(zeroblob(30000)); CREATE TABLE aux.t2(x);
INSERT INTO t1 SELECT * FROM t2; INSERT INTO t2 VALUES(zeroblob(30000));
DELETE FROM t2; INSERT INTO t1 SELECT * FROM t2;
DELETE FROM t1; DELETE FROM t2;
} DELETE FROM t1;
list [file size test.db] [file size test2.db] }
} {32768 32768} list [file size test.db] [file size test2.db]
do_test incrvacuum2-2.2 { } {32768 32768}
execsql { do_test incrvacuum2-2.2 {
PRAGMA aux.incremental_vacuum(1) execsql {
} PRAGMA aux.incremental_vacuum(1)
list [file size test.db] [file size test2.db] }
} {32768 31744} list [file size test.db] [file size test2.db]
do_test incrvacuum2-2.3 { } {32768 31744}
execsql { do_test incrvacuum2-2.3 {
PRAGMA aux.incremental_vacuum(5) execsql {
} PRAGMA aux.incremental_vacuum(5)
list [file size test.db] [file size test2.db] }
} {32768 26624} list [file size test.db] [file size test2.db]
do_test incrvacuum2-2.4 { } {32768 26624}
execsql { do_test incrvacuum2-2.4 {
PRAGMA main.incremental_vacuum(5) execsql {
} PRAGMA main.incremental_vacuum(5)
list [file size test.db] [file size test2.db] }
} {27648 26624} list [file size test.db] [file size test2.db]
do_test incrvacuum2-2.5 { } {27648 26624}
execsql { do_test incrvacuum2-2.5 {
PRAGMA aux.incremental_vacuum execsql {
} PRAGMA aux.incremental_vacuum
list [file size test.db] [file size test2.db] }
} {27648 3072} list [file size test.db] [file size test2.db]
do_test incrvacuum2-2.6 { } {27648 3072}
execsql { do_test incrvacuum2-2.6 {
PRAGMA incremental_vacuum(1) execsql {
} PRAGMA incremental_vacuum(1)
list [file size test.db] [file size test2.db] }
} {26624 3072} list [file size test.db] [file size test2.db]
} {26624 3072}
}

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the INSERT transfer optimization. # focus of this file is testing the INSERT transfer optimization.
# #
# $Id: insert4.test,v 1.7 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: insert4.test,v 1.8 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -234,15 +234,20 @@ xfer_check insert4-3.22 1 {1 9} \
# Ticket #2291. # Ticket #2291.
# #
do_test insert4-4.1 {
execsql { do_test insert4-4.1a {
CREATE TABLE t4(a, b, UNIQUE(a,b)); execsql {CREATE TABLE t4(a, b, UNIQUE(a,b))}
INSERT INTO t4 VALUES(NULL,0);
INSERT INTO t4 VALUES(NULL,1);
INSERT INTO t4 VALUES(NULL,1);
VACUUM;
}
} {} } {}
ifcapable vacuum {
do_test insert4-4.1b {
execsql {
INSERT INTO t4 VALUES(NULL,0);
INSERT INTO t4 VALUES(NULL,1);
INSERT INTO t4 VALUES(NULL,1);
VACUUM;
}
} {}
}
# Check some error conditions: # Check some error conditions:
# #

View File

@ -13,7 +13,7 @@
# IO traffic generated by SQLite (making sure SQLite is not writing out # IO traffic generated by SQLite (making sure SQLite is not writing out
# more database pages than it has to, stuff like that). # more database pages than it has to, stuff like that).
# #
# $Id: io.test,v 1.11 2007/10/03 21:18:20 drh Exp $ # $Id: io.test,v 1.12 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -229,36 +229,38 @@ do_test io-2.6.4 {
# use the same technique to check that it is created as in the above # use the same technique to check that it is created as in the above
# block. # block.
file delete -force test2.db test2.db-journal file delete -force test2.db test2.db-journal
do_test io-2.7.1 { ifcapable attach {
execsql { do_test io-2.7.1 {
ATTACH 'test2.db' AS aux; execsql {
PRAGMA aux.page_size = 1024; ATTACH 'test2.db' AS aux;
CREATE TABLE aux.abc2(a, b); PRAGMA aux.page_size = 1024;
BEGIN; CREATE TABLE aux.abc2(a, b);
INSERT INTO abc VALUES(9, 10); BEGIN;
} INSERT INTO abc VALUES(9, 10);
file exists test.db-journal }
} {0} file exists test.db-journal
do_test io-2.7.2 { } {0}
execsql { INSERT INTO abc2 SELECT * FROM abc } do_test io-2.7.2 {
file exists test2.db-journal execsql { INSERT INTO abc2 SELECT * FROM abc }
} {0} file exists test2.db-journal
do_test io-2.7.3 { } {0}
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 } do_test io-2.7.3 {
} {1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10} execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
do_test io-2.7.4 { } {1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10}
set fd [open test2.db-journal w] do_test io-2.7.4 {
puts $fd "This is not a journal file" set fd [open test2.db-journal w]
close $fd puts $fd "This is not a journal file"
catchsql { COMMIT } close $fd
} {1 {unable to open database file}} catchsql { COMMIT }
do_test io-2.7.5 { } {1 {unable to open database file}}
file delete -force test2.db-journal do_test io-2.7.5 {
catchsql { COMMIT } file delete -force test2.db-journal
} {1 {cannot commit - no transaction is active}} catchsql { COMMIT }
do_test io-2.7.6 { } {1 {cannot commit - no transaction is active}}
execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 } do_test io-2.7.6 {
} {1 2 3 4 5 6 7 8} execsql { SELECT * FROM abc UNION ALL SELECT * FROM abc2 }
} {1 2 3 4 5 6 7 8}
}
# Try an explicit ROLLBACK before the journal file is created. # Try an explicit ROLLBACK before the journal file is created.
# #

View File

@ -15,7 +15,7 @@
# The tests in this file use special facilities that are only # The tests in this file use special facilities that are only
# available in the SQLite test fixture. # available in the SQLite test fixture.
# #
# $Id: ioerr.test,v 1.32 2007/09/01 17:00:13 danielk1977 Exp $ # $Id: ioerr.test,v 1.33 2007/10/09 08:29:32 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -118,22 +118,24 @@ do_ioerr_test ioerr-4 -tclprep {
# #
# Tests 8 and 17 are excluded when auto-vacuum is enabled for the same # Tests 8 and 17 are excluded when auto-vacuum is enabled for the same
# reason as in test cases ioerr-1.XXX # reason as in test cases ioerr-1.XXX
set ex "" ifcapable attach {
if {[string match [execsql {pragma auto_vacuum}] 1]} { set ex ""
set ex [list 4 17] if {[string match [execsql {pragma auto_vacuum}] 1]} {
set ex [list 4 17]
}
do_ioerr_test ioerr-5 -sqlprep {
ATTACH 'test2.db' AS test2;
} -sqlbody {
BEGIN;
CREATE TABLE t1(a,b,c);
CREATE TABLE test2.t2(a,b,c);
COMMIT;
} -exclude $ex
} }
do_ioerr_test ioerr-5 -sqlprep {
ATTACH 'test2.db' AS test2;
} -sqlbody {
BEGIN;
CREATE TABLE t1(a,b,c);
CREATE TABLE test2.t2(a,b,c);
COMMIT;
} -exclude $ex
# Test IO errors when replaying two hot journals from a 2-file # Test IO errors when replaying two hot journals from a 2-file
# transaction. This test only runs on UNIX. # transaction. This test only runs on UNIX.
ifcapable crashtest { ifcapable crashtest&&attach {
if {![catch {sqlite3 -has_codec} r] && !$r} { if {![catch {sqlite3 -has_codec} r] && !$r} {
do_ioerr_test ioerr-6 -tclprep { do_ioerr_test ioerr-6 -tclprep {
execsql { execsql {

View File

@ -16,7 +16,7 @@
# to see what happens in the library if a malloc were to really fail # to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation. # due to an out-of-memory situation.
# #
# $Id: malloc.test,v 1.50 2007/10/03 15:02:40 danielk1977 Exp $ # $Id: malloc.test,v 1.51 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -293,7 +293,7 @@ do_malloc_test 12 -tclbody {
# Test malloc errors when replaying two hot journals from a 2-file # Test malloc errors when replaying two hot journals from a 2-file
# transaction. # transaction.
ifcapable crashtest { ifcapable crashtest&&attach {
do_malloc_test 13 -tclprep { do_malloc_test 13 -tclprep {
set rc [crashsql -delay 1 -file test2.db { set rc [crashsql -delay 1 -file test2.db {
ATTACH 'test2.db' as aux; ATTACH 'test2.db' as aux;
@ -477,23 +477,25 @@ unset static_string
# Make sure SQLITE_NOMEM is reported out on an ATTACH failure even # Make sure SQLITE_NOMEM is reported out on an ATTACH failure even
# when the malloc failure occurs within the nested parse. # when the malloc failure occurs within the nested parse.
# #
do_malloc_test 20 -tclprep { ifcapable attach {
db close do_malloc_test 20 -tclprep {
file delete -force test2.db test2.db-journal db close
sqlite3 db test2.db file delete -force test2.db test2.db-journal
sqlite3_extended_result_codes db 1 sqlite3 db test2.db
db eval {CREATE TABLE t1(x);} sqlite3_extended_result_codes db 1
db close db eval {CREATE TABLE t1(x);}
} -tclbody { db close
if {[catch {sqlite3 db test.db}]} { } -tclbody {
error "out of memory" if {[catch {sqlite3 db test.db}]} {
} error "out of memory"
sqlite3_extended_result_codes db 1 }
} -sqlbody { sqlite3_extended_result_codes db 1
ATTACH DATABASE 'test2.db' AS t2; } -sqlbody {
SELECT * FROM t1; ATTACH DATABASE 'test2.db' AS t2;
DETACH DATABASE t2; SELECT * FROM t1;
} DETACH DATABASE t2;
}
}
# Test malloc failure whilst installing a foreign key. # Test malloc failure whilst installing a foreign key.
# #

View File

@ -13,7 +13,7 @@
# correctly. The emphasis of these tests are the _prepare(), _step() and # correctly. The emphasis of these tests are the _prepare(), _step() and
# _finalize() calls. # _finalize() calls.
# #
# $Id: malloc3.test,v 1.16 2007/10/03 08:46:45 danielk1977 Exp $ # $Id: malloc3.test,v 1.17 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -462,25 +462,27 @@ TEST 29 {
# Test a simple multi-file transaction # Test a simple multi-file transaction
# #
file delete -force test2.db file delete -force test2.db
SQL {ATTACH 'test2.db' AS aux;} ifcapable attach {
SQL {BEGIN} SQL {ATTACH 'test2.db' AS aux;}
SQL {CREATE TABLE aux.tbl2(x, y, z)} SQL {BEGIN}
SQL {INSERT INTO tbl2 VALUES(1, 2, 3)} SQL {CREATE TABLE aux.tbl2(x, y, z)}
SQL {INSERT INTO def VALUES(4, 5, 6)} SQL {INSERT INTO tbl2 VALUES(1, 2, 3)}
TEST 30 { SQL {INSERT INTO def VALUES(4, 5, 6)}
do_test $testid { TEST 30 {
execsql { do_test $testid {
SELECT * FROM tbl2, def WHERE d = x; execsql {
} SELECT * FROM tbl2, def WHERE d = x;
} {1 2 3 1 2 3} }
} } {1 2 3 1 2 3}
SQL {COMMIT} }
TEST 31 { SQL {COMMIT}
do_test $testid { TEST 31 {
execsql { do_test $testid {
SELECT * FROM tbl2, def WHERE d = x; execsql {
} SELECT * FROM tbl2, def WHERE d = x;
} {1 2 3 1 2 3} }
} {1 2 3 1 2 3}
}
} }
# Test what happens when a malloc() fails while there are other active # Test what happens when a malloc() fails while there are other active

View File

@ -9,7 +9,7 @@
# #
#*********************************************************************** #***********************************************************************
# #
# $Id: mallocD.test,v 1.3 2007/09/03 17:02:50 drh Exp $ # $Id: mallocD.test,v 1.4 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -48,12 +48,14 @@ do_malloc_test mallocD-3 -sqlprep $PREP -sqlbody {
COMMIT; COMMIT;
} }
do_malloc_test mallocD-4 -sqlprep $PREP -sqlbody { ifcapable attach {
ATTACH 'test2.db' AS aux; do_malloc_test mallocD-4 -sqlprep $PREP -sqlbody {
BEGIN; ATTACH 'test2.db' AS aux;
CREATE TABLE aux.def(d, e, f); BEGIN;
INSERT INTO abc VALUES(4, 5, 6); CREATE TABLE aux.def(d, e, f);
COMMIT; INSERT INTO abc VALUES(4, 5, 6);
COMMIT;
}
} }
sqlite3_simulate_device -char {} sqlite3_simulate_device -char {}

View File

@ -12,7 +12,7 @@
# #
# This file implements tests for the PRAGMA command. # This file implements tests for the PRAGMA command.
# #
# $Id: pragma.test,v 1.54 2007/05/17 16:38:30 danielk1977 Exp $ # $Id: pragma.test,v 1.55 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -210,33 +210,33 @@ do_test pragma-1.18 {
} {} } {}
# Test modifying the safety_level of an attached database. # Test modifying the safety_level of an attached database.
do_test pragma-2.1 { ifcapable pager_pragmas&&attach {
file delete -force test2.db do_test pragma-2.1 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
ATTACH 'test2.db' AS aux; execsql {
} ATTACH 'test2.db' AS aux;
} {} }
ifcapable pager_pragmas { } {}
do_test pragma-2.2 { do_test pragma-2.2 {
execsql { execsql {
pragma aux.synchronous; pragma aux.synchronous;
} }
} {2} } {2}
do_test pragma-2.3 { do_test pragma-2.3 {
execsql { execsql {
pragma aux.synchronous = OFF; pragma aux.synchronous = OFF;
pragma aux.synchronous; pragma aux.synchronous;
pragma synchronous; pragma synchronous;
} }
} {0 2} } {0 2}
do_test pragma-2.4 { do_test pragma-2.4 {
execsql { execsql {
pragma aux.synchronous = ON; pragma aux.synchronous = ON;
pragma synchronous; pragma synchronous;
pragma aux.synchronous; pragma aux.synchronous;
} }
} {2 1} } {2 1}
} ;# ifcapable pager_pragmas } ;# ifcapable pager_pragmas
# Construct a corrupted index and make sure the integrity_check # Construct a corrupted index and make sure the integrity_check
@ -259,158 +259,160 @@ do_test pragma-3.1 {
SELECT rowid, * from t2; SELECT rowid, * from t2;
} }
} {1 11 2 3 2 22 3 4} } {1 11 2 3 2 22 3 4}
if {![sqlite3 -has-codec] && $sqlite_options(integrityck)} { ifcapable attach {
do_test pragma-3.2 { if {![sqlite3 -has-codec] && $sqlite_options(integrityck)} {
set rootpage [execsql {SELECT rootpage FROM sqlite_master WHERE name='i2'}] do_test pragma-3.2 {
set db [btree_open test.db 100 0] set rootpage [execsql {SELECT rootpage FROM sqlite_master WHERE name='i2'}]
btree_begin_transaction $db set db [btree_open test.db 100 0]
set c [btree_cursor $db $rootpage 1] btree_begin_transaction $db
btree_first $c set c [btree_cursor $db $rootpage 1]
btree_delete $c btree_first $c
btree_commit $db btree_delete $c
btree_close $db btree_commit $db
execsql {PRAGMA integrity_check} btree_close $db
} {{rowid 1 missing from index i2} {wrong # of entries in index i2}} execsql {PRAGMA integrity_check}
do_test pragma-3.3 { } {{rowid 1 missing from index i2} {wrong # of entries in index i2}}
execsql {PRAGMA integrity_check=1} do_test pragma-3.3 {
} {{rowid 1 missing from index i2}} execsql {PRAGMA integrity_check=1}
do_test pragma-3.4 { } {{rowid 1 missing from index i2}}
execsql { do_test pragma-3.4 {
ATTACH DATABASE 'test.db' AS t2; execsql {
PRAGMA integrity_check ATTACH DATABASE 'test.db' AS t2;
} PRAGMA integrity_check
} {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}} }
do_test pragma-3.5 { } {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
execsql { do_test pragma-3.5 {
PRAGMA integrity_check=3 execsql {
} PRAGMA integrity_check=3
} {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2}} }
do_test pragma-3.6 { } {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2}}
execsql { do_test pragma-3.6 {
PRAGMA integrity_check=xyz execsql {
} PRAGMA integrity_check=xyz
} {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}} }
do_test pragma-3.7 { } {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
execsql { do_test pragma-3.7 {
PRAGMA integrity_check=0 execsql {
} PRAGMA integrity_check=0
} {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}} }
} {{rowid 1 missing from index i2} {wrong # of entries in index i2} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
# Add additional corruption by appending unused pages to the end of
# the database file testerr.db # Add additional corruption by appending unused pages to the end of
# # the database file testerr.db
do_test pragma-3.8 { #
execsql {DETACH t2} do_test pragma-3.8 {
file delete -force testerr.db testerr.db-journal execsql {DETACH t2}
set out [open testerr.db w] file delete -force testerr.db testerr.db-journal
fconfigure $out -translation binary set out [open testerr.db w]
set in [open test.db r] fconfigure $out -translation binary
fconfigure $in -translation binary set in [open test.db r]
puts -nonewline $out [read $in] fconfigure $in -translation binary
seek $in 0 puts -nonewline $out [read $in]
puts -nonewline $out [read $in] seek $in 0
close $in puts -nonewline $out [read $in]
close $out close $in
execsql {REINDEX t2} close $out
execsql {PRAGMA integrity_check} execsql {REINDEX t2}
} {ok} execsql {PRAGMA integrity_check}
do_test pragma-3.9 { } {ok}
execsql { do_test pragma-3.9 {
ATTACH 'testerr.db' AS t2; execsql {
PRAGMA integrity_check ATTACH 'testerr.db' AS t2;
} PRAGMA integrity_check
} {{*** in database t2 *** }
} {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}} Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
do_test pragma-3.10 { do_test pragma-3.10 {
execsql { execsql {
PRAGMA integrity_check=1 PRAGMA integrity_check=1
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used}} Page 4 is never used}}
do_test pragma-3.11 { do_test pragma-3.11 {
execsql { execsql {
PRAGMA integrity_check=5 PRAGMA integrity_check=5
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}} Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
do_test pragma-3.12 { do_test pragma-3.12 {
execsql { execsql {
PRAGMA integrity_check=4 PRAGMA integrity_check=4
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2}} Page 6 is never used} {rowid 1 missing from index i2}}
do_test pragma-3.13 { do_test pragma-3.13 {
execsql { execsql {
PRAGMA integrity_check=3 PRAGMA integrity_check=3
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used}} Page 6 is never used}}
do_test pragma-3.14 { do_test pragma-3.14 {
execsql { execsql {
PRAGMA integrity_check(2) PRAGMA integrity_check(2)
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used}} Page 5 is never used}}
do_test pragma-3.15 { do_test pragma-3.15 {
execsql { execsql {
ATTACH 'testerr.db' AS t3; ATTACH 'testerr.db' AS t3;
PRAGMA integrity_check PRAGMA integrity_check
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 *** Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}} Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2}}
do_test pragma-3.16 { do_test pragma-3.16 {
execsql { execsql {
PRAGMA integrity_check(9) PRAGMA integrity_check(9)
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 *** Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2}} Page 6 is never used} {rowid 1 missing from index i2}}
do_test pragma-3.17 { do_test pragma-3.17 {
execsql { execsql {
PRAGMA integrity_check=7 PRAGMA integrity_check=7
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 *** Page 6 is never used} {rowid 1 missing from index i2} {wrong # of entries in index i2} {*** in database t3 ***
Page 4 is never used Page 4 is never used
Page 5 is never used}} Page 5 is never used}}
do_test pragma-3.18 { do_test pragma-3.18 {
execsql { execsql {
PRAGMA integrity_check=4 PRAGMA integrity_check=4
} }
} {{*** in database t2 *** } {{*** in database t2 ***
Page 4 is never used Page 4 is never used
Page 5 is never used Page 5 is never used
Page 6 is never used} {rowid 1 missing from index i2}} Page 6 is never used} {rowid 1 missing from index i2}}
}
do_test pragma-3.99 {
catchsql {DETACH t3}
catchsql {DETACH t2}
file delete -force testerr.db testerr.db-journal
catchsql {DROP INDEX i2}
} {0 {}}
} }
do_test pragma-3.99 {
catchsql {DETACH t3}
catchsql {DETACH t2}
file delete -force testerr.db testerr.db-journal
catchsql {DROP INDEX i2}
} {0 {}}
# Test modifying the cache_size of an attached database. # Test modifying the cache_size of an attached database.
ifcapable pager_pragmas { ifcapable pager_pragmas&&attach {
do_test pragma-4.1 { do_test pragma-4.1 {
execsql { execsql {
ATTACH 'test2.db' AS aux; ATTACH 'test2.db' AS aux;
@ -481,7 +483,7 @@ catchsql {COMMIT;}
# Test schema-query pragmas # Test schema-query pragmas
# #
ifcapable schema_pragmas { ifcapable schema_pragmas {
ifcapable tempdb { ifcapable tempdb&&attach {
do_test pragma-6.1 { do_test pragma-6.1 {
set res {} set res {}
execsql {SELECT * FROM sqlite_temp_master} execsql {SELECT * FROM sqlite_temp_master}
@ -647,18 +649,20 @@ do_test pragma-8.1.10 {
# Make sure the schema-version can be manipulated in an attached database. # Make sure the schema-version can be manipulated in an attached database.
file delete -force test2.db file delete -force test2.db
file delete -force test2.db-journal file delete -force test2.db-journal
do_test pragma-8.1.11 { ifcapable attach {
execsql { do_test pragma-8.1.11 {
ATTACH 'test2.db' AS aux; execsql {
CREATE TABLE aux.t1(a, b, c); ATTACH 'test2.db' AS aux;
PRAGMA aux.schema_version = 205; CREATE TABLE aux.t1(a, b, c);
} PRAGMA aux.schema_version = 205;
} {} }
do_test pragma-8.1.12 { } {}
execsql { do_test pragma-8.1.12 {
PRAGMA aux.schema_version; execsql {
} PRAGMA aux.schema_version;
} 205 }
} 205
}
do_test pragma-8.1.13 { do_test pragma-8.1.13 {
execsql { execsql {
PRAGMA schema_version; PRAGMA schema_version;
@ -667,28 +671,30 @@ do_test pragma-8.1.13 {
# And check that modifying the schema-version in an attached database # And check that modifying the schema-version in an attached database
# forces the second connection to reload the schema. # forces the second connection to reload the schema.
do_test pragma-8.1.14 { ifcapable attach {
sqlite3 db2 test.db; set ::DB2 [sqlite3_connection_pointer db2] do_test pragma-8.1.14 {
execsql { sqlite3 db2 test.db; set ::DB2 [sqlite3_connection_pointer db2]
ATTACH 'test2.db' AS aux; execsql {
SELECT * FROM aux.t1; ATTACH 'test2.db' AS aux;
} db2 SELECT * FROM aux.t1;
} {} } db2
do_test pragma-8.1.15 { } {}
execsql { do_test pragma-8.1.15 {
PRAGMA aux.schema_version = 206; execsql {
} PRAGMA aux.schema_version = 206;
} {} }
do_test pragma-8.1.16 { } {}
set ::STMT [sqlite3_prepare $::DB2 "SELECT * FROM aux.t1" -1 DUMMY] do_test pragma-8.1.16 {
sqlite3_step $::STMT set ::STMT [sqlite3_prepare $::DB2 "SELECT * FROM aux.t1" -1 DUMMY]
} SQLITE_ERROR sqlite3_step $::STMT
do_test pragma-8.1.17 { } SQLITE_ERROR
sqlite3_finalize $::STMT do_test pragma-8.1.17 {
} SQLITE_SCHEMA sqlite3_finalize $::STMT
do_test pragma-8.1.18 { } SQLITE_SCHEMA
db2 close do_test pragma-8.1.18 {
} {} db2 close
} {}
}
# Now test that the user-version can be read and written (and that we aren't # Now test that the user-version can be read and written (and that we aren't
# accidentally manipulating the schema-version instead). # accidentally manipulating the schema-version instead).
@ -732,61 +738,64 @@ ifcapable vacuum {
} }
} {109} } {109}
} }
db eval {ATTACH 'test2.db' AS aux}
# Check that the user-version in the auxilary database can be manipulated ( ifcapable attach {
# and that we aren't accidentally manipulating the same in the main db). db eval {ATTACH 'test2.db' AS aux}
do_test pragma-8.2.5 {
execsql { # Check that the user-version in the auxilary database can be manipulated (
PRAGMA aux.user_version; # and that we aren't accidentally manipulating the same in the main db).
} do_test pragma-8.2.5 {
} {0} execsql {
do_test pragma-8.2.6 { PRAGMA aux.user_version;
execsql { }
PRAGMA aux.user_version = 3; } {0}
} do_test pragma-8.2.6 {
} {} execsql {
do_test pragma-8.2.7 { PRAGMA aux.user_version = 3;
execsql { }
PRAGMA aux.user_version; } {}
} do_test pragma-8.2.7 {
} {3} execsql {
do_test pragma-8.2.8 { PRAGMA aux.user_version;
execsql { }
PRAGMA main.user_version; } {3}
} do_test pragma-8.2.8 {
} {2} execsql {
PRAGMA main.user_version;
# Now check that a ROLLBACK resets the user-version if it has been modified }
# within a transaction. } {2}
do_test pragma-8.2.9 {
execsql { # Now check that a ROLLBACK resets the user-version if it has been modified
BEGIN; # within a transaction.
PRAGMA aux.user_version = 10; do_test pragma-8.2.9 {
PRAGMA user_version = 11; execsql {
} BEGIN;
} {} PRAGMA aux.user_version = 10;
do_test pragma-8.2.10 { PRAGMA user_version = 11;
execsql { }
PRAGMA aux.user_version; } {}
} do_test pragma-8.2.10 {
} {10} execsql {
do_test pragma-8.2.11 { PRAGMA aux.user_version;
execsql { }
PRAGMA main.user_version; } {10}
} do_test pragma-8.2.11 {
} {11} execsql {
do_test pragma-8.2.12 { PRAGMA main.user_version;
execsql { }
ROLLBACK; } {11}
PRAGMA aux.user_version; do_test pragma-8.2.12 {
} execsql {
} {3} ROLLBACK;
do_test pragma-8.2.13 { PRAGMA aux.user_version;
execsql { }
PRAGMA main.user_version; } {3}
} do_test pragma-8.2.13 {
} {2} execsql {
PRAGMA main.user_version;
}
} {2}
}
# Try a negative value for the user-version # Try a negative value for the user-version
do_test pragma-8.2.14 { do_test pragma-8.2.14 {

View File

@ -12,7 +12,7 @@
# #
# This file implements tests for the PRAGMA command. # This file implements tests for the PRAGMA command.
# #
# $Id: pragma2.test,v 1.3 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: pragma2.test,v 1.4 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -64,54 +64,56 @@ do_test pragma2-1.4 {
file delete -force test2.db file delete -force test2.db
file delete -force test2.db-journal file delete -force test2.db-journal
do_test pragma2-2.1 { ifcapable attach {
execsql { do_test pragma2-2.1 {
ATTACH 'test2.db' AS aux; execsql {
PRAGMA aux.auto_vacuum=OFF; ATTACH 'test2.db' AS aux;
PRAGMA aux.freelist_count; PRAGMA aux.auto_vacuum=OFF;
} PRAGMA aux.freelist_count;
} {0} }
do_test pragma2-2.2 { } {0}
execsql { do_test pragma2-2.2 {
CREATE TABLE aux.abc(a, b, c); execsql {
PRAGMA aux.freelist_count; CREATE TABLE aux.abc(a, b, c);
} PRAGMA aux.freelist_count;
} {0} }
do_test pragma2-2.3 { } {0}
set ::val [string repeat 0123456789 1000] do_test pragma2-2.3 {
execsql { set ::val [string repeat 0123456789 1000]
INSERT INTO aux.abc VALUES(1, 2, $::val); execsql {
PRAGMA aux.freelist_count; INSERT INTO aux.abc VALUES(1, 2, $::val);
} PRAGMA aux.freelist_count;
} {0} }
do_test pragma2-2.4 { } {0}
expr {[file size test2.db] / 1024} do_test pragma2-2.4 {
} {11} expr {[file size test2.db] / 1024}
do_test pragma2-2.5 { } {11}
execsql { do_test pragma2-2.5 {
DELETE FROM aux.abc; execsql {
PRAGMA aux.freelist_count; DELETE FROM aux.abc;
} PRAGMA aux.freelist_count;
} {9} }
} {9}
do_test pragma2-3.1 {
execsql { do_test pragma2-3.1 {
PRAGMA aux.freelist_count; execsql {
PRAGMA main.freelist_count; PRAGMA aux.freelist_count;
PRAGMA freelist_count; PRAGMA main.freelist_count;
} PRAGMA freelist_count;
} {9 1 1} }
do_test pragma2-3.2 { } {9 1 1}
execsql { do_test pragma2-3.2 {
PRAGMA freelist_count = 500; execsql {
PRAGMA freelist_count; PRAGMA freelist_count = 500;
} PRAGMA freelist_count;
} {1 1} }
do_test pragma2-3.3 { } {1 1}
execsql { do_test pragma2-3.3 {
PRAGMA aux.freelist_count = 500; execsql {
PRAGMA aux.freelist_count; PRAGMA aux.freelist_count = 500;
} PRAGMA aux.freelist_count;
} {9 9} }
} {9 9}
}
finish_test finish_test

View File

@ -13,7 +13,7 @@
# This file tests the various conditions under which an SQLITE_SCHEMA # This file tests the various conditions under which an SQLITE_SCHEMA
# error should be returned. # error should be returned.
# #
# $Id: schema.test,v 1.7 2007/08/13 15:28:35 danielk1977 Exp $ # $Id: schema.test,v 1.8 2007/10/09 08:29:33 danielk1977 Exp $
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# When any of the following types of SQL statements or actions are # When any of the following types of SQL statements or actions are
@ -141,26 +141,28 @@ do_test schema-4.4 {
# Tests 5.1 to 5.4 check that prepared statements are invalidated when # Tests 5.1 to 5.4 check that prepared statements are invalidated when
# a database is DETACHed (but not when one is ATTACHed). # a database is DETACHed (but not when one is ATTACHed).
# #
do_test schema-5.1 { ifcapable attach {
set sql {SELECT * FROM abc;} do_test schema-5.1 {
set ::STMT [sqlite3_prepare $::DB $sql -1 TAIL] set sql {SELECT * FROM abc;}
execsql { set ::STMT [sqlite3_prepare $::DB $sql -1 TAIL]
ATTACH 'test2.db' AS aux; execsql {
} ATTACH 'test2.db' AS aux;
sqlite3_step $::STMT }
} {SQLITE_DONE} sqlite3_step $::STMT
do_test schema-5.2 { } {SQLITE_DONE}
sqlite3_reset $::STMT do_test schema-5.2 {
} {SQLITE_OK} sqlite3_reset $::STMT
do_test schema-5.3 { } {SQLITE_OK}
execsql { do_test schema-5.3 {
DETACH aux; execsql {
} DETACH aux;
sqlite3_step $::STMT }
} {SQLITE_ERROR} sqlite3_step $::STMT
do_test schema-5.4 { } {SQLITE_ERROR}
sqlite3_finalize $::STMT do_test schema-5.4 {
} {SQLITE_SCHEMA} sqlite3_finalize $::STMT
} {SQLITE_SCHEMA}
}
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Tests 6.* check that prepared statements are invalidated when # Tests 6.* check that prepared statements are invalidated when

View File

@ -14,7 +14,7 @@
# error should be returned. This is a copy of schema.test that # error should be returned. This is a copy of schema.test that
# has been altered to use sqlite3_prepare_v2 instead of sqlite3_prepare # has been altered to use sqlite3_prepare_v2 instead of sqlite3_prepare
# #
# $Id: schema2.test,v 1.2 2007/05/02 17:54:56 drh Exp $ # $Id: schema2.test,v 1.3 2007/10/09 08:29:33 danielk1977 Exp $
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# When any of the following types of SQL statements or actions are # When any of the following types of SQL statements or actions are
@ -142,26 +142,28 @@ do_test schema2-4.4 {
# Tests 5.1 to 5.4 check that prepared statements are invalidated when # Tests 5.1 to 5.4 check that prepared statements are invalidated when
# a database is DETACHed (but not when one is ATTACHed). # a database is DETACHed (but not when one is ATTACHed).
# #
do_test schema2-5.1 { ifcapable attach {
set sql {SELECT * FROM abc;} do_test schema2-5.1 {
set ::STMT [sqlite3_prepare_v2 $::DB $sql -1 TAIL] set sql {SELECT * FROM abc;}
execsql { set ::STMT [sqlite3_prepare_v2 $::DB $sql -1 TAIL]
ATTACH 'test2.db' AS aux; execsql {
} ATTACH 'test2.db' AS aux;
sqlite3_step $::STMT }
} {SQLITE_DONE} sqlite3_step $::STMT
do_test schema2-5.2 { } {SQLITE_DONE}
sqlite3_reset $::STMT do_test schema2-5.2 {
} {SQLITE_OK} sqlite3_reset $::STMT
do_test schema2-5.3 { } {SQLITE_OK}
execsql { do_test schema2-5.3 {
DETACH aux; execsql {
} DETACH aux;
sqlite3_step $::STMT }
} {SQLITE_DONE} sqlite3_step $::STMT
do_test schema2-5.4 { } {SQLITE_DONE}
sqlite3_finalize $::STMT do_test schema2-5.4 {
} {SQLITE_OK} sqlite3_finalize $::STMT
} {SQLITE_OK}
}
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Tests 6.* check that prepared statements are invalidated when # Tests 6.* check that prepared statements are invalidated when

View File

@ -9,13 +9,15 @@
# #
#*********************************************************************** #***********************************************************************
# #
# $Id: shared.test,v 1.27 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: shared.test,v 1.28 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
db close db close
ifcapable !shared_cache { # These tests cannot be run without the ATTACH command.
#
ifcapable !shared_cache||!attach {
finish_test finish_test
return return
} }

View File

@ -12,7 +12,7 @@
# focus of this script is testing that the overflow-page related # focus of this script is testing that the overflow-page related
# enhancements added after version 3.3.17 speed things up. # enhancements added after version 3.3.17 speed things up.
# #
# $Id: speed3.test,v 1.4 2007/09/12 17:01:45 danielk1977 Exp $ # $Id: speed3.test,v 1.5 2007/10/09 08:29:33 danielk1977 Exp $
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
@ -35,7 +35,7 @@
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !tclvar { ifcapable !tclvar||!attach {
finish_test finish_test
return return
} }

View File

@ -12,7 +12,7 @@
# This file contains tests to verify that the limits defined in # This file contains tests to verify that the limits defined in
# sqlite source file limits.h are enforced. # sqlite source file limits.h are enforced.
# #
# $Id: sqllimits1.test,v 1.18 2007/09/06 23:39:37 drh Exp $ # $Id: sqllimits1.test,v 1.19 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -440,23 +440,24 @@ do_test sqllimits-1.7.2 {
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Test cases sqllimits-8.*: Test the SQLITE_MAX_ATTACHED limit. # Test cases sqllimits-8.*: Test the SQLITE_MAX_ATTACHED limit.
# #
# TODO ifcapable attach {
do_test sqllimits-1.8.1 { do_test sqllimits-1.8.1 {
set max $::SQLITE_MAX_ATTACHED set max $::SQLITE_MAX_ATTACHED
for {set i 0} {$i < ($max)} {incr i} { for {set i 0} {$i < ($max)} {incr i} {
file delete -force test${i}.db test${i}.db-journal file delete -force test${i}.db test${i}.db-journal
} }
for {set i 0} {$i < ($max)} {incr i} { for {set i 0} {$i < ($max)} {incr i} {
execsql "ATTACH 'test${i}.db' AS aux${i}" execsql "ATTACH 'test${i}.db' AS aux${i}"
} }
catchsql "ATTACH 'test${i}.db' AS aux${i}" catchsql "ATTACH 'test${i}.db' AS aux${i}"
} "1 {too many attached databases - max $::SQLITE_MAX_ATTACHED}" } "1 {too many attached databases - max $::SQLITE_MAX_ATTACHED}"
do_test sqllimits-1.8.2 { do_test sqllimits-1.8.2 {
set max $::SQLITE_MAX_ATTACHED set max $::SQLITE_MAX_ATTACHED
for {set i 0} {$i < ($max)} {incr i} { for {set i 0} {$i < ($max)} {incr i} {
execsql "DETACH aux${i}" execsql "DETACH aux${i}"
} }
} {} } {}
}
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Test cases sqllimits-9.*: Check that the SQLITE_MAX_VARIABLE_NUMBER # Test cases sqllimits-9.*: Check that the SQLITE_MAX_VARIABLE_NUMBER

View File

@ -13,20 +13,21 @@
# This file implements tests to verify that fsync is disabled when # This file implements tests to verify that fsync is disabled when
# pragma synchronous=off even for multi-database commits. # pragma synchronous=off even for multi-database commits.
# #
# $Id: sync.test,v 1.5 2006/02/11 01:25:51 drh Exp $ # $Id: sync.test,v 1.6 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
# #
# These tests are only applicable on unix when pager pragma are # These tests are only applicable on unix when pager pragma are
# enabled. # enabled. Also, since every test uses an ATTACHed database, they
# are only run when ATTACH is enabled.
# #
if {$::tcl_platform(platform)!="unix"} { if {$::tcl_platform(platform)!="unix"} {
finish_test finish_test
return return
} }
ifcapable !pager_pragmas { ifcapable !pager_pragmas||!attach {
finish_test finish_test
return return
} }

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the CREATE TABLE statement. # focus of this file is testing the CREATE TABLE statement.
# #
# $Id: table.test,v 1.47 2007/05/02 17:54:56 drh Exp $ # $Id: table.test,v 1.48 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -612,7 +612,7 @@ do_test table-14.1 {
} {0 {}} } {0 {}}
# Try to drop a table from within a callback: # Try to drop a table from within a callback:
do_test table-14.3 { do_test table-14.2 {
set rc [ set rc [
catch { catch {
db eval {SELECT * FROM tablet8 LIMIT 1} {} { db eval {SELECT * FROM tablet8 LIMIT 1} {} {
@ -623,33 +623,35 @@ do_test table-14.3 {
set result [list $rc $msg] set result [list $rc $msg]
} {1 {database table is locked}} } {1 {database table is locked}}
# Now attach a database and ensure that a table can be created in the ifcapable attach {
# attached database whilst in a callback from a query on the main database. # Now attach a database and ensure that a table can be created in the
do_test table-14.4 { # attached database whilst in a callback from a query on the main database.
file delete -force test2.db do_test table-14.3 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
attach 'test2.db' as aux; execsql {
} ATTACH 'test2.db' as aux;
db eval {SELECT * FROM tablet8 LIMIT 1} {} { }
db eval {CREATE TABLE aux.t1(a, b, c)} db eval {SELECT * FROM tablet8 LIMIT 1} {} {
} db eval {CREATE TABLE aux.t1(a, b, c)}
} {} }
} {}
# On the other hand, it should be impossible to drop a table when any VMs
# are active. This is because VerifyCookie instructions may have already # On the other hand, it should be impossible to drop a table when any VMs
# been executed, and btree root-pages may not move after this (which a # are active. This is because VerifyCookie instructions may have already
# delete table might do). # been executed, and btree root-pages may not move after this (which a
do_test table-14.4 { # delete table might do).
set rc [ do_test table-14.4 {
catch { set rc [
db eval {SELECT * FROM tablet8 LIMIT 1} {} { catch {
db eval {DROP TABLE aux.t1;} db eval {SELECT * FROM tablet8 LIMIT 1} {} {
} db eval {DROP TABLE aux.t1;}
} msg }
] } msg
set result [list $rc $msg] ]
} {1 {database table is locked}} set result [list $rc $msg]
} {1 {database table is locked}}
}
# Create and drop 2000 tables. This is to check that the balance_shallow() # Create and drop 2000 tables. This is to check that the balance_shallow()
# routine works correctly on the sqlite_master table. At one point it # routine works correctly on the sqlite_master table. At one point it

View File

@ -12,7 +12,7 @@
# #
# This file implements tests for temporary tables and indices. # This file implements tests for temporary tables and indices.
# #
# $Id: temptable.test,v 1.18 2007/10/05 15:53:29 danielk1977 Exp $ # $Id: temptable.test,v 1.19 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -404,12 +404,14 @@ do_test temptable-6.8 {
} {1 {no such table: t9}} } {1 {no such table: t9}}
file delete -force test2.db test2.db-journal file delete -force test2.db test2.db-journal
do_test temptable-7.1 { ifcapable attach {
catchsql { do_test temptable-7.1 {
ATTACH 'test2.db' AS two; catchsql {
CREATE TEMP TABLE two.abc(x,y); ATTACH 'test2.db' AS two;
} CREATE TEMP TABLE two.abc(x,y);
} {1 {temporary table name must be unqualified}} }
} {1 {temporary table name must be unqualified}}
}
# Need to do the following for tcl 8.5 on mac. On that configuration, the # Need to do the following for tcl 8.5 on mac. On that configuration, the
# -readonly flag is taken so seriously that a subsequent [file delete -force] # -readonly flag is taken so seriously that a subsequent [file delete -force]

View File

@ -12,13 +12,18 @@
# This test attempts to deadlock SQLite in shared-cache mode. # This test attempts to deadlock SQLite in shared-cache mode.
# #
# #
# $Id: thread002.test,v 1.1 2007/09/10 10:53:02 danielk1977 Exp $ # $Id: thread002.test,v 1.2 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
source $testdir/thread_common.tcl source $testdir/thread_common.tcl
if {[info commands sqlthread] eq ""} { if {[info commands sqlthread] eq ""} {
finish_test
return
}
ifcapable !attach {
finish_test
return return
} }

View File

@ -14,11 +14,16 @@
# fixed. # fixed.
# #
# #
# $Id: tkt1873.test,v 1.1 2006/06/27 16:34:58 danielk1977 Exp $ # $Id: tkt1873.test,v 1.2 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
ifcapable !attach {
finish_test
return
}
file delete -force test2.db test2.db-journal file delete -force test2.db test2.db-journal
do_test tkt1873-1.1 { do_test tkt1873-1.1 {

View File

@ -532,7 +532,7 @@ ifcapable conflict {
# Also verify that references within trigger programs are resolved at # Also verify that references within trigger programs are resolved at
# statement compile time, not trigger installation time. This means, for # statement compile time, not trigger installation time. This means, for
# example, that you can drop and re-create tables referenced by triggers. # example, that you can drop and re-create tables referenced by triggers.
ifcapable tempdb { ifcapable tempdb&&attach {
do_test trigger1-10.0 { do_test trigger1-10.0 {
file delete -force test2.db file delete -force test2.db
file delete -force test2.db-journal file delete -force test2.db-journal

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing VIEW statements. # focus of this file is testing VIEW statements.
# #
# $Id: view.test,v 1.33 2006/09/11 23:45:50 drh Exp $ # $Id: view.test,v 1.34 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -450,14 +450,16 @@ do_test view-12.1 {
} }
} {1 {parameters are not allowed in views}} } {1 {parameters are not allowed in views}}
do_test view-13.1 { ifcapable attach {
file delete -force test2.db do_test view-13.1 {
catchsql { file delete -force test2.db
ATTACH 'test2.db' AS two; catchsql {
CREATE TABLE two.t2(x,y); ATTACH 'test2.db' AS two;
CREATE VIEW v13 AS SELECT y FROM two.t2; CREATE TABLE two.t2(x,y);
} CREATE VIEW v13 AS SELECT y FROM two.t2;
} {1 {view v13 cannot reference objects in database two}} }
} {1 {view v13 cannot reference objects in database two}}
}
# Ticket #1658 # Ticket #1658
# #

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is creating and dropping virtual tables. # focus of this file is creating and dropping virtual tables.
# #
# $Id: vtab1.test,v 1.46 2007/09/03 15:03:21 danielk1977 Exp $ # $Id: vtab1.test,v 1.47 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -762,20 +762,24 @@ do_test vtab1.7-13 {
} }
} {} } {}
do_test vtab1.8-1 { ifcapable attach {
set echo_module "" do_test vtab1.8-1 {
execsql { set echo_module ""
ATTACH 'test2.db' AS aux; execsql {
CREATE VIRTUAL TABLE aux.e2 USING echo(real_abc); ATTACH 'test2.db' AS aux;
} CREATE VIRTUAL TABLE aux.e2 USING echo(real_abc);
set echo_module }
} [list xCreate echo aux e2 real_abc \ set echo_module
xSync echo(real_abc) \ } [list xCreate echo aux e2 real_abc \
xCommit echo(real_abc) \ xSync echo(real_abc) \
] xCommit echo(real_abc) \
]
}
do_test vtab1.8-2 { do_test vtab1.8-2 {
execsql { catchsql {
DROP TABLE aux.e2; DROP TABLE aux.e2;
}
execsql {
DROP TABLE treal; DROP TABLE treal;
DROP TABLE techo; DROP TABLE techo;
DROP TABLE echo_abc; DROP TABLE echo_abc;

View File

@ -12,7 +12,7 @@
# of this test is reading and writing to the database from within a # of this test is reading and writing to the database from within a
# virtual table xSync() callback. # virtual table xSync() callback.
# #
# $Id: vtab7.test,v 1.2 2006/07/26 16:22:16 danielk1977 Exp $ # $Id: vtab7.test,v 1.3 2007/10/09 08:29:33 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -125,21 +125,23 @@ do_test vtab7-2.6 {
} {abc abc2 log} } {abc abc2 log}
# Write to an attached database from xSync(). # Write to an attached database from xSync().
do_test vtab7-3.1 { ifcapable attach {
file delete -force test2.db do_test vtab7-3.1 {
file delete -force test2.db-journal file delete -force test2.db
execsql { file delete -force test2.db-journal
ATTACH 'test2.db' AS db2; execsql {
CREATE TABLE db2.stuff(description, shape, color); ATTACH 'test2.db' AS db2;
} CREATE TABLE db2.stuff(description, shape, color);
set ::callbacks(xSync,abc) { }
execsql { INSERT INTO db2.stuff VALUES('abc', 'square', 'green'); } set ::callbacks(xSync,abc) {
} execsql { INSERT INTO db2.stuff VALUES('abc', 'square', 'green'); }
execsql { }
INSERT INTO abc2 VALUES(1, 2, 3); execsql {
SELECT * from stuff; INSERT INTO abc2 VALUES(1, 2, 3);
} SELECT * from stuff;
} {abc square green} }
} {abc square green}
}
# UPDATE: The next test passes, but leaks memory. So leave it out. # UPDATE: The next test passes, but leaks memory. So leave it out.
# #