1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add test cases for ticket [be436a7f4587ce517] using virtual table modules fts5

and rtree.

FossilOrigin-Name: 2101b4208787d297788e05f2bd82d4a9aff26e2237a7016ac857a52fb5252ce0
This commit is contained in:
dan
2017-08-17 14:12:16 +00:00
parent dc6b41ed47
commit 865c3c58ab
4 changed files with 312 additions and 7 deletions

View File

@ -0,0 +1,56 @@
# 2017 August 17
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
# The focus of this file is testing the r-tree extension. Specifically,
# the impact of an SQLITE_SCHEMA error within the rtree module xConnect
# callback.
#
if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source $testdir/tester.tcl
set testprefix rtreeconnect
ifcapable !rtree {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE r1 USING rtree(id, x1, x2, y1, y2);
CREATE TABLE t1(id, x1, x2, y1, y2);
CREATE TABLE log(l);
CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
INSERT INTO r1 VALUES(new.id, new.x1, new.x2, new.y1, new.y2);
INSERT INTO log VALUES('r1: ' || new.id);
END;
}
db close
sqlite3 db test.db
sqlite3 db2 test.db
do_test 1.1 {
db eval { INSERT INTO log VALUES('startup'); }
db2 eval { CREATE TABLE newtable(x,y); }
} {}
do_execsql_test 1.2 {
INSERT INTO t1 VALUES(1, 2, 3, 4, 5);
}
db2 close
db close
finish_test