Add the ability to disable the push-down optimization using the 0x1000 bit
[sqlite.git] / test / tkt1873.test
blob9930790c747d846171c6015c7b5644fc87c5a4d6
1 # 2006 June 27
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 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests to verify that ticket #1873 has been
14 # fixed.  
17 # $Id: tkt1873.test,v 1.2 2007/10/09 08:29:33 danielk1977 Exp $
19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl
22 ifcapable !attach {
23   finish_test
24   return
27 forcedelete test2.db test2.db-journal
29 do_test tkt1873-1.1 {
30   execsql {
31     CREATE TABLE t1(x, y);
32     ATTACH 'test2.db' AS aux;
33     CREATE TABLE aux.t2(x, y);
34     INSERT INTO t1 VALUES(1, 2);
35     INSERT INTO t1 VALUES(3, 4);
36     INSERT INTO t2 VALUES(5, 6);
37     INSERT INTO t2 VALUES(7, 8);
38   }
39 } {}
41 do_test tkt1873-1.2 {
42   set rc [catch {
43     db eval {SELECT * FROM t2 LIMIT 1} {
44       db eval {DETACH aux}
45     }
46   } msg]
47   list $rc $msg
48 } {1 {database aux is locked}}
50 do_test tkt1873-1.3 {
51   set rc [catch {
52     db eval {SELECT * FROM t1 LIMIT 1} {
53       db eval {DETACH aux}
54     }
55   } msg]
56   list $rc $msg
57 } {0 {}}
59 do_test tkt1873-1.4 {
60   catchsql {
61     select * from t2;
62   }
63 } {1 {no such table: t2}}
65 do_test tkt1873-1.5 {
66   catchsql {
67     ATTACH 'test2.db' AS aux;
68     select * from t2;
69   }
70 } {0 {5 6 7 8}}
72 finish_test