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 #***********************************************************************
13 if {![info exists testdir]} {
14 set testdir [file join [file dirname [info script]] .. .. test]
16 source [file join [file dirname [info script]] session_common.tcl]
17 source $testdir/tester.tcl
18 ifcapable !session {finish_test; return}
19 set testprefix sessionH
26 CREATE TABLE t1(a, b, c, PRIMARY KEY(a, b));
28 do_then_apply_sql -ignorenoop {
30 VALUES(1) UNION ALL SELECT i+1 FROM s WHERe i<10000
32 INSERT INTO t1 SELECT 'abcde', randomblob(16), i FROM s;
37 #------------------------------------------------------------------------
42 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
43 INSERT INTO main.t1 VALUES(1, 2, 3), (4, 5, 6), (7, 8, 9);
47 sqlite3session S db main
51 INSERT INTO t1 VALUES(10, 11, 12);
52 DELETE FROM t1 WHERE a=1;
53 UPDATE t1 SET b='five', c='six' WHERE a=4;
63 CREATE TEMP TABLE t1(a INTEGER PRIMARY KEY, b, c);
64 INSERT INTO temp.t1 VALUES(1, 2, 3), (4, 5, 6), (7, 8, 9);
68 proc xConflict {args} { lappend ::conflict $args ; return "" }
70 sqlite3changeset_apply db $C xConflict
74 SELECT * FROM main.t1;
76 SELECT * FROM temp.t1;
78 4 five six 7 8 9 10 11 12