Extra ".selecttrace" output following aggregate analysis. No changes to
[sqlite.git] / ext / rtree / rtreeconnect.test
blob16d04d9a047ad7bb19a43696a27f6a9ce2c62905
1 # 2017 August 17
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 # The focus of this file is testing the r-tree extension. Specifically,
13 # the impact of an SQLITE_SCHEMA error within the rtree module xConnect
14 # callback.
18 if {![info exists testdir]} {
19   set testdir [file join [file dirname [info script]] .. .. test]
20
21 source $testdir/tester.tcl
22 set testprefix rtreeconnect
24 ifcapable !rtree {
25   finish_test
26   return
29 do_execsql_test 1.0 {
30   CREATE VIRTUAL TABLE r1 USING rtree(id, x1, x2, y1, y2);
31   CREATE TABLE t1(id, x1, x2, y1, y2);
32   CREATE TABLE log(l);
34   CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
35     INSERT INTO r1 VALUES(new.id, new.x1, new.x2, new.y1, new.y2);
36     INSERT INTO log VALUES('r1: ' || new.id);
37   END;
40 db close
41 sqlite3 db  test.db
42 sqlite3 db2 test.db
44 do_test 1.1 {
45   db eval { INSERT INTO log VALUES('startup'); }
46   db2 eval { CREATE TABLE newtable(x,y); }
47 } {}
49 do_execsql_test 1.2 {
50   INSERT INTO t1 VALUES(1, 2, 3, 4, 5);
53 db2 close
54 db close
56 finish_test