/ Check-in [894c142d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a couple of extra test-suite problems with SQLITE_OMIT_VIEW. (CVS 2139)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:894c142d115b31506b6b8212e1b850ea28c4ca11
User & Date: danielk1977 2004-11-22 15:05:59
Context
2004-11-22
19:07
Fix a long-standing bug in btree.c in the sqlite3BtreePrevious() routine. The problem has gone unnoticed before now because it only occurs when you use the OP_Prev opcode on a B+Tree. (CVS 2140) check-in: 3d2536c4 user: drh tags: trunk
15:05
Fix a couple of extra test-suite problems with SQLITE_OMIT_VIEW. (CVS 2139) check-in: 894c142d user: danielk1977 tags: trunk
13:35
Ensure tests pass when SQLITE_OMIT_COMPOUND_SELECT is defined. (CVS 2138) check-in: 007be591 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/misc2.test.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
36
37
38
39
40
41
42
43
44
45
46
47
48
49





50
51
52
53
54
55
56
57
58
59
60
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc2.test,v 1.17 2004/11/22 13:35:42 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable {trigger} {
# Test for ticket #360
#
................................................................................
    INSERT INTO foo(bar) VALUES (111);
  }
} {1 aiieee}
} ;# endif trigger

# Make sure ROWID works on a view and a subquery.  Ticket #364
#
ifcapable view {
do_test misc2-2.1 {
  execsql {
    CREATE TABLE t1(a,b,c);
    INSERT INTO t1 VALUES(1,2,3);
    CREATE TABLE t2(a,b,c);
    INSERT INTO t2 VALUES(7,8,9);





    SELECT rowid, * FROM (SELECT * FROM t1, t2);
  }
} {{} 1 2 3 7 8 9}
do_test misc2-2.2 {
  execsql {
    CREATE VIEW v1 AS SELECT * FROM t1, t2;
    SELECT rowid, * FROM v1;
  }
} {{} 1 2 3 7 8 9}
} ;# ifcapable view








|







 







<






>
>
>
>
>



|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc2.test,v 1.18 2004/11/22 15:05:59 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable {trigger} {
# Test for ticket #360
#
................................................................................
    INSERT INTO foo(bar) VALUES (111);
  }
} {1 aiieee}
} ;# endif trigger

# Make sure ROWID works on a view and a subquery.  Ticket #364
#

do_test misc2-2.1 {
  execsql {
    CREATE TABLE t1(a,b,c);
    INSERT INTO t1 VALUES(1,2,3);
    CREATE TABLE t2(a,b,c);
    INSERT INTO t2 VALUES(7,8,9);
  }
} {}
ifcapable view {
do_test misc2-2.2 {
  execsql {
    SELECT rowid, * FROM (SELECT * FROM t1, t2);
  }
} {{} 1 2 3 7 8 9}
do_test misc2-2.3 {
  execsql {
    CREATE VIEW v1 AS SELECT * FROM t1, t2;
    SELECT rowid, * FROM v1;
  }
} {{} 1 2 3 7 8 9}
} ;# ifcapable view

Changes to test/select6.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
398
399
400
401
402
403
404



405
406
407
408
409
410
411
412

413
414
415
416
417
418
419
...
425
426
427
428
429
430
431

432
433
434
435
436
437
438
439
440
441
442

443
444
445
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing SELECT statements that contain
# subqueries in their FROM clause.
#
# $Id: select6.test,v 1.14 2004/11/22 13:35:42 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

do_test select6-1.0 {
  execsql {
    BEGIN;
................................................................................
  execsql {
    SELECT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
} {1 1 11 111 2 2 22 222 2 2 22 222}



do_test select6-8.3 {
  is_flat {
    SELECT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
} {1}

do_test select6-8.4 {
  execsql {
    SELECT DISTINCT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
................................................................................
         (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
         (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
      WHERE  y=p) AS e,
      (SELECT r AS z FROM t4 WHERE q=11) AS f
    WHERE e.r=f.z
  }
} {1 1 11 111 111}

do_test select6-8.6 {
  is_flat {
    SELECT * FROM 
      (SELECT y, p, q, r FROM
         (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
         (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
      WHERE  y=p) AS e,
      (SELECT r AS z FROM t4 WHERE q=11) AS f
    WHERE e.r=f.z
  }
} {1}



finish_test







|







 







>
>
>








>







 







>











>



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
...
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing SELECT statements that contain
# subqueries in their FROM clause.
#
# $Id: select6.test,v 1.15 2004/11/22 15:05:59 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

do_test select6-1.0 {
  execsql {
    BEGIN;
................................................................................
  execsql {
    SELECT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
} {1 1 11 111 2 2 22 222 2 2 22 222}
# If view support is omitted from the build, then so is the query 
# "flattener". So omit this test and test select6-8.6 in that case.
ifcapable view {
do_test select6-8.3 {
  is_flat {
    SELECT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
} {1}
} ;# ifcapable view
do_test select6-8.4 {
  execsql {
    SELECT DISTINCT y, p, q, r FROM
       (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
       (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
    WHERE  y=p
  }
................................................................................
         (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
         (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
      WHERE  y=p) AS e,
      (SELECT r AS z FROM t4 WHERE q=11) AS f
    WHERE e.r=f.z
  }
} {1 1 11 111 111}
ifcapable view {
do_test select6-8.6 {
  is_flat {
    SELECT * FROM 
      (SELECT y, p, q, r FROM
         (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
         (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
      WHERE  y=p) AS e,
      (SELECT r AS z FROM t4 WHERE q=11) AS f
    WHERE e.r=f.z
  }
} {1}
} ;# ifcapable view


finish_test