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 #***********************************************************************
12 # Tests for the sqlite3_changes() and sqlite3_total_changes() APIs.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix changes
19 # To test that the change-counters do not suffer from 32-bit signed integer
20 # rollover, add the following line to the array of test cases below. The
21 # test will take will over an hour to run.
26 foreach {tn nRow wor} {
31 4 5000 "WITHOUT ROWID"
34 6 50000 "WITHOUT ROWID"
39 do_execsql_test 1.$tn.0 "
40 PRAGMA journal_mode = off;
41 CREATE TABLE t1(x INTEGER PRIMARY KEY) $wor;
44 do_execsql_test 1.$tn.1 {
46 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i < $nBig
48 INSERT INTO t1 SELECT i FROM s;
59 do_execsql_test 1.$tn.4 {
60 INSERT INTO t1 VALUES(-1)
71 do_execsql_test 1.$tn.7a {
72 SELECT count(*) FROM t1
75 do_execsql_test 1.$tn.7 {
85 } [expr {2*($nBig+1)}]