1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Make the LIMIT clause work even if the destination of the SELECT is

something other than a callback.  (Ticket #66) (CVS 619)

FossilOrigin-Name: 699cf362083043615eb88635a228bfa46a315c9c
This commit is contained in:
drh
2002-06-14 22:38:41 +00:00
parent c27a1ce4bd
commit df199a25bd
8 changed files with 134 additions and 82 deletions

View File

@ -12,7 +12,7 @@
# focus of this file is testing the LIMIT ... OFFSET ... clause
# of SELECT statements.
#
# $Id: limit.test,v 1.2 2002/05/24 16:14:16 drh Exp $
# $Id: limit.test,v 1.3 2002/06/14 22:38:43 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -56,5 +56,23 @@ do_test limit-1.7 {
execsql {SELECT * FROM t1 AS a, t1 AS b ORDER BY a.x, b.x LIMIT 5 OFFSET 32}
} {1 5 0 5 1 5 1 5 1 5 2 5 1 5 3 5 1 5 4 5}
do_test limit-2.1 {
execsql {
CREATE VIEW v1 AS SELECT * FROM t1 LIMIT 2;
SELECT count(*) FROM (SELECT * FROM v1);
}
} 2
do_test limit-2.2 {
execsql {
CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 2;
SELECT count(*) FROM t2;
}
} 2
do_test limit-2.3 {
execsql {
SELECT count(*) FROM t1 WHERE rowid IN (SELECT rowid FROM t1 LIMIT 2);
}
} 2
finish_test

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the use of indices in WHERE clases.
#
# $Id: where.test,v 1.7 2002/06/09 01:55:20 drh Exp $
# $Id: where.test,v 1.8 2002/06/14 22:38:43 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -249,7 +249,7 @@ do_test where-4.2 {
count {
SELECT * FROM t1 WHERE 1 LIMIT 1
}
} {1 0 4 0}
} {1 0 4 1}
do_test where-4.3 {
execsql {
SELECT 99 WHERE 0