3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests to make sure that leftover journals from
14 # prior databases do not try to rollback into new databases.
16 # $Id: journal1.test,v 1.2 2005/03/20 22:54:56 drh Exp $
19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl
22 # These tests will not work on windows because windows uses
23 # manditory file locking which breaks the file copy command.
25 if {$tcl_platform(platform)=="windows"} {
30 # Create a smaple database
32 do_test journal1-1.1 {
35 INSERT INTO t1 VALUES(1,randstr(10,400));
36 INSERT INTO t1 VALUES(2,randstr(10,400));
37 INSERT INTO t1 SELECT a+2, a||b FROM t1;
38 INSERT INTO t1 SELECT a+4, a||b FROM t1;
39 SELECT count(*) FROM t1;
43 # Make changes to the database and save the journal file.
44 # Then delete the database. Replace the the journal file
45 # and try to create a new database with the same name. The
46 # old journal should not attempt to rollback into the new
49 do_test journal1-1.2 {
54 file copy -force test.db-journal test.db-journal-bu
60 file copy test.db-journal-bu test.db-journal
63 SELECT * FROM sqlite_master