1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Make LIMIT 0 return no rows. LIMIT -1 still returns all rows. Ticket #346. (CVS 1053)

FossilOrigin-Name: a31d0bd90af7cc95f8e36ca8ece21515f872235e
This commit is contained in:
drh
2003-07-16 11:51:35 +00:00
parent ef0cae500d
commit a88dc3f629
5 changed files with 32 additions and 16 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.8 2003/07/16 02:19:38 drh Exp $
# $Id: limit.test,v 1.9 2003/07/16 11:51:36 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -194,13 +194,23 @@ do_test limit-6.4 {
} {3 4}
do_test limit-6.5 {
execsql {
SELECT * FROM t6 LIMIT 0
SELECT * FROM t6 LIMIT -1
}
} {1 2 3 4}
do_test limit-6.6 {
execsql {
SELECT * FROM t6 LIMIT 0 OFFSET 1
SELECT * FROM t6 LIMIT -1 OFFSET 1
}
} {2 3 4}
do_test limit-6.7 {
execsql {
SELECT * FROM t6 LIMIT 0
}
} {}
do_test limit-6.8 {
execsql {
SELECT * FROM t6 LIMIT 0 OFFSET 1
}
} {}
finish_test