Improved error messages. Limit the number of auxiliary columns to 100.
[sqlite.git] / ext / rtree / rtreeD.test
blob7f92898b0ab1de392f9eba5f7a46059d2111ba01
1 # 2014 March 11
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 # Miscellaneous tests for errors in the rtree constructor.
16 if {![info exists testdir]} {
17   set testdir [file join [file dirname [info script]] .. .. test]
18
19 source [file join [file dirname [info script]] rtree_util.tcl]
20 source $testdir/tester.tcl
21 source $testdir/lock_common.tcl
22 ifcapable !rtree||!builtin_test {
23   finish_test
24   return
26 set testprefix rtreeD
28 #-------------------------------------------------------------------------
29 # Test that if an SQLITE_BUSY is encountered within the vtable 
30 # constructor, a relevant error message is returned.
32 do_multiclient_test tn {
33   do_test 1.$tn.1 {
34     sql1 {
35       CREATE TABLE t1(a, b);
36       INSERT INTO t1 VALUES(1,2);
37       CREATE VIRTUAL TABLE rt USING rtree(id, minx, maxx, miny, maxy);
38       INSERT INTO rt VALUES(1,2,3,4,5);
39     }
40   } {}
42   do_test 1.$tn.2 {
43     sql2 { SELECT * FROM t1; }
44   } {1 2}
46   do_test 1.$tn.3 {
47     sql1 { BEGIN EXCLUSIVE; INSERT INTO t1 VALUES(3, 4); }
48   } {}
50   do_test 1.$tn.4 {
51     list [catch { sql2 { SELECT * FROM rt } } msg] $msg
52   } {1 {database is locked}}
55 finish_test