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:
@ -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
|
||||
|
Reference in New Issue
Block a user