/ Check-in [72a067f0]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Tests for the subquery flattening fix of check-in (2987). (CVS 2988)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 72a067f0df5818c0fdb3b9f8af20f83bb2e1dd34
User & Date: drh 2006-01-22 00:14:39
Context
2006-01-22
00:42
Code size reductions in select.c. (CVS 2989) check-in: 3c2eee5e user: drh tags: trunk
00:14
Tests for the subquery flattening fix of check-in (2987). (CVS 2988) check-in: 72a067f0 user: drh tags: trunk
2006-01-21
22:19
Do not flatten subqueries in a join where the subquery includes a LIMIT. Ticket #1634. This is just an initial fix. Many test cases need to be added prior to closing the ticket. (CVS 2987) check-in: af18c0f4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/select6.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
449
450
451
452
453
454
455
456

457
















































458
#    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.21 2005/11/14 22:29:06 drh Exp $

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

# Omit this whole file if the library is build without subquery support.
ifcapable !subquery {
  finish_test
................................................................................
         (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







|







 








>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
#    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.22 2006/01/22 00:14:39 drh Exp $

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

# Omit this whole file if the library is build without subquery support.
ifcapable !subquery {
  finish_test
................................................................................
         (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

# Ticket #1634
#
do_test select6-9.1 {
  execsql {
    SELECT a.x, b.x FROM t1 AS a, (SELECT x FROM t1 LIMIT 2) AS b
  }
} {1 1 1 2 2 1 2 2 3 1 3 2 4 1 4 2}
do_test select6-9.2 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT 2);
  }
} {1 2}
do_test select6-9.3 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT 2 OFFSET 1);
  }
} {2 3}
do_test select6-9.4 {
  execsql {
    SELECT x FROM (SELECT x FROM t1) LIMIT 2;
  }
} {1 2}
do_test select6-9.5 {
  execsql {
    SELECT x FROM (SELECT x FROM t1) LIMIT 2 OFFSET 1;
  }
} {2 3}
do_test select6-9.6 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT 2) LIMIT 3;
  }
} {1 2}
do_test select6-9.7 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT -1) LIMIT 3;
  }
} {1 2 3}
do_test select6-9.8 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT -1);
  }
} {1 2 3 4}
do_test select6-9.9 {
  execsql {
    SELECT x FROM (SELECT x FROM t1 LIMIT -1 OFFSET 1);
  }
} {2 3 4}



finish_test