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 # $Id: tkt2339.test,v 1.2 2007/09/12 17:01:45 danielk1977 Exp $
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
18 ifcapable !subquery||!compound {
25 create table t1(num int);
26 insert into t1 values (1);
27 insert into t1 values (2);
28 insert into t1 values (3);
29 insert into t1 values (4);
31 create table t2(num int);
32 insert into t2 values (11);
33 insert into t2 values (12);
34 insert into t2 values (13);
35 insert into t2 values (14);
37 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
39 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
44 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
46 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
51 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC)
53 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
58 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
60 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
65 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
67 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
72 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
74 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC)
79 SELECT * FROM (SELECT * FROM t1 LIMIT 2)
81 SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2)
86 SELECT * FROM (SELECT * FROM t1 LIMIT 2)
88 SELECT * FROM (SELECT * FROM t2 LIMIT 2)
93 SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2)
95 SELECT * FROM (SELECT * FROM t2 LIMIT 2)