diff --git a/manifest b/manifest index f0ff011d8b..418cf976c6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Don't\scall\sctype\sfunctions\son\shi-bit\schars.\s\sSome\splatforms\sraise\nassertions\swhen\sthis\soccurs,\sand\sit's\salmost\scertainly\snot\sthe\sright\nthing\sto\sdo\sin\sthe\sfirst\splace.\s(CVS\s3746) -D 2007-03-29T16:30:39 +C Add\sa\scouple\sof\stest\scases\sto\simprove\scoverage\stesting.\s(CVS\s3747) +D 2007-03-29T17:07:53 F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -256,7 +256,7 @@ F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1 F test/lock2.test d83ba79d3c4fffdb5b926c7d8ca7a36c34288a55 F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9 F test/main.test e7212ce1023957c7209778cc87fa932bd79ba89a -F test/malloc.test 33020a87791e32302c0a30c2ce2816134a944a3b +F test/malloc.test 2c39d97c8db5fdc06bb105122a59721f4ea9ac49 F test/malloc2.test 4ed7d719542c4570dec9c2ebe2bbdf3a9f3b0d05 F test/malloc3.test e965954b6f808876a63d3101fd70370320b509a7 F test/malloc4.test 59cd02f71b363302a04c4e77b97c0a1572eaa210 @@ -273,7 +273,7 @@ F test/misc3.test 7bd937e2c62bcc6be71939faf068d506467b1e03 F test/misc4.test b043a05dea037cca5989f3ae09552fa16119bc80 F test/misc5.test c7d2d2a5a20dc37d3605a8067f0df5af2240122e F test/misc6.test 3de55ec5cadf466ada587173faa5d6a4790a8bb7 -F test/misc7.test 9b3bd914a863809a95f9cb66ce320327e9aaee79 +F test/misc7.test bc52702ade3d18d94af193b487ce86b2e4704dc1 F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33 F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82 F test/null.test 9503e1f63e959544c006d9f01709c5b5eab67d54 @@ -446,7 +446,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 54fa22273d551e00e1abd86992ff7c62ec4e0daf -R 6645d4541d0d9e478c5b564689374f5f -U shess -Z 5e17544799ed91760b443021ffc206bc +P f6c3abdc6c5e916e5366ba28fb1cd06ca3554303 +R 510e38c64873ba345896fd1daf2242a2 +U danielk1977 +Z f759617c0297932d47953cae5b14ea24 diff --git a/manifest.uuid b/manifest.uuid index 7d1b46cd55..77623f4582 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f6c3abdc6c5e916e5366ba28fb1cd06ca3554303 \ No newline at end of file +0b22ce3637f87c453084c5bd994b6b19a0b014c0 \ No newline at end of file diff --git a/test/malloc.test b/test/malloc.test index 03cc816cae..8d9358a6ae 100644 --- a/test/malloc.test +++ b/test/malloc.test @@ -14,7 +14,7 @@ # special feature is used to see what happens in the library if a malloc # were to really fail due to an out-of-memory situation. # -# $Id: malloc.test,v 1.38 2007/03/26 12:26:27 danielk1977 Exp $ +# $Id: malloc.test,v 1.39 2007/03/29 17:07:53 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -546,6 +546,12 @@ do_malloc_test 20 -tclprep { DETACH DATABASE t2; } +# Test malloc failure whilst installing a foriegn key. +# +do_malloc_test 21 -sqlbody { + CREATE TABLE abc(a, b, c, FOREIGN KEY(a) REFERENCES abc(b)) +} + # Ensure that no file descriptors were leaked. do_test malloc-99.X { diff --git a/test/misc7.test b/test/misc7.test index 6292c41087..23884c47ba 100644 --- a/test/misc7.test +++ b/test/misc7.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# $Id: misc7.test,v 1.1 2007/03/29 12:19:12 danielk1977 Exp $ +# $Id: misc7.test,v 1.2 2007/03/29 17:07:53 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -27,4 +27,75 @@ do_test misc7-3 { c_collation_test } {} +# Try to open a directory: +# +do_test misc7-4 { + file delete mydir + file mkdir mydir + set rc [catch { + sqlite3 db2 ./mydir + } msg] + list $rc $msg +} {1 {unable to open database file}} + +# Try to open a file with a directory where it's journal file should be. +# +do_test misc7-5 { + file delete mydir + file mkdir mydir-journal + sqlite3 db2 ./mydir + catchsql { + CREATE TABLE abc(a, b, c); + } db2 +} {1 {unable to open database file}} +db2 close + +#-------------------------------------------------------------------- +# The following tests, misc7-6.* test the libraries behaviour when +# it cannot open a file. To force this condition, we use up all the +# file-descriptors before running sqlite. This probably only works +# on unix. +# + +proc use_up_files {} { + set ret [list] + catch { + while 1 { lappend ret [open test.db] } + } + return $ret +} + +execsql { CREATE TABLE abc(a PRIMARY KEY, b, c); } +db close +set fd_list [use_up_files] + +set ::go 1 +set ::n 1 +while {$::go} { + catch {db close} + do_test misc7-6.$::n { + set rc [catch { + sqlite db test.db + db eval { + BEGIN; + INSERT INTO abc VALUES(1, 2, 3); + INSERT INTO abc VALUES(2, 3, 4); + INSERT INTO abc SELECT a+2, b, c FROM abc; + COMMIT; + } + } msg] + if {$rc == 0} {set ::go 0} + + expr {$rc == 0 || ($rc == 1 && $msg eq "unable to open database file")} + } 1 + + close [lindex $fd_list 0] + set fd_list [lrange $fd_list 1 end] + incr ::n +} +foreach fd $fd_list { + close $fd +} + finish_test +