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. The
12 # focus of this file is testing the test_sqllog.c module.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
31 proc delete_all_sqllog_files {} {
32 forcedelete {*}[glob -nocomplain sqllog_*.sql]
33 forcedelete {*}[glob -nocomplain sqllog_*.db]
34 forcedelete {*}[glob -nocomplain sqllog_*.idx]
44 set ::env(SQLITE_SQLLOG_DIR) [pwd]
46 delete_all_sqllog_files
52 CREATE TABLE t1(x, y);
53 INSERT INTO t1 VALUES(1, 2);
54 INSERT INTO t1 VALUES($a, $b);
60 readfile [lindex [glob sqllog_*.sql] 0]
62 /-- Main database is '.*/sqllog_.*_0.db'
63 CREATE TABLE t1\(x, y\);; -- clock=0
64 INSERT INTO t1 VALUES\(1, 2\);; -- clock=1
65 INSERT INTO t1 VALUES\('a', 'b'\);; -- clock=2
66 SELECT . FROM t1;; -- clock=3
70 file size [lindex [glob sqllog_*_0.db] 0]
73 #-------------------------------------------------------------------------
76 delete_all_sqllog_files
77 forcedelete test.db-sqllog
79 set ::env(SQLITE_SQLLOG_CONDITIONAL) 1
82 INSERT INTO t1 VALUES(4, 5);
87 glob -nocomplain sqllog_*
94 INSERT INTO t1 VALUES(6, 7);
100 readfile [lindex [glob sqllog_*.sql] 0]
102 /-- Main database is '.*/sqllog_.*_0.db'
103 INSERT INTO t1 VALUES\(6, 7\);; -- clock=0
104 SELECT . FROM t1;; -- clock=1
109 unset ::env(SQLITE_SQLLOG_DIR)
110 unset ::env(SQLITE_SQLLOG_CONDITIONAL)
111 sqlite3_config_sqllog