-C Minor\scode\sand\scomment\scleanup.\s(CVS\s2165)
-D 2004-12-14T03:34:34
+C Make\ssure\sLIMITs\sare\shandled\scorrectly\son\sUNION\soperators.\s\sTicket\s#1035.\s(CVS\s2166)
+D 2004-12-16T21:09:17
F Makefile.in da09f379b80c8cd78d78abaa0f32ca90a124e884
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
F src/pragma.c d6406e12c9eac353b3a026b50d41e4fd561afcc2
F src/printf.c 3d20b21cfecadacecac3fb7274e746cb81d3d357
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
-F src/select.c 36cc9da999596578566e167d310e99f2005a7f03
+F src/select.c ac6610b4b2c5bd5ffc46536b760dacc420119dac
F src/shell.c e8f4f486cbf6e60d81173146ac8a6522c930fa51
F src/sqlite.h.in fa75850f412808afd38fddc1fd6456f4efc6fb97
F src/sqliteInt.h e0c5c1af95e975645c7a09b151af258d6fca1c53
F test/join4.test 8dec387d06b3a4685e1104048065cf5236b99b93
F test/lastinsert.test b6a1db3e1ce2d3f0d6afe99d445084f543b6feaa
F test/laststmtchanges.test 07cbdabc52407c29e40abc25050f2434f044a6b1
-F test/limit.test c7bddad249631ad068fbbd0ab926e04ba7e3b9a2
+F test/limit.test 0225cadf96f199566b6d1ae7b5642492878ec45a
F test/lock.test 32fe28e5030f25f23bcf6beef440675b0d848413
F test/lock2.test 59c3dd7d9b24d1bf7ec91b2d1541c37e97939d5f
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c
-P 7f38f67c7b427ea46db2e95fdfadc1aae064c704
-R 0372084bee24d5ee507746e9b7def4a4
+P d012628a78edaa8d3cb438a7dcc3770b2eb8588b
+R bd08228a6f97570ef1438e0425471e15
U drh
-Z 08a84bfe20c08dc8299c4719dba55eae
+Z fcfd946d19b12e062ea66108631d01be
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.217 2004/11/23 01:47:30 drh Exp $
+** $Id: select.c,v 1.218 2004/12/16 21:09:17 drh Exp $
*/
#include "sqliteInt.h"
p->pOrderBy = pOrderBy;
p->nLimit = nLimit;
p->nOffset = nOffset;
+ p->iLimit = -1;
+ p->iOffset = -1;
if( rc ){
goto multi_select_end;
}
# focus of this file is testing the LIMIT ... OFFSET ... clause
# of SELECT statements.
#
-# $Id: limit.test,v 1.18 2004/11/22 13:35:42 danielk1977 Exp $
+# $Id: limit.test,v 1.19 2004/12/16 21:09:18 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
}
} {25 26 27 28 29}
+# Make sure limits on multiple subqueries work correctly.
+# Ticket #1035
+#
+do_test limit-9.1 {
+ execsql {
+ SELECT * FROM (SELECT * FROM t6 LIMIT 3);
+ }
+} {1 2 3}
+do_test limit-9.2 {
+ execsql {
+ CREATE TABLE t7 AS SELECT * FROM t6;
+ SELECT * FROM (SELECT * FROM t7 LIMIT 3);
+ }
+} {1 2 3}
+do_test limit-9.3 {
+ execsql {
+ SELECT * FROM (SELECT * FROM t6 LIMIT 3)
+ UNION
+ SELECT * FROM (SELECT * FROM t7 LIMIT 3)
+ ORDER BY 1
+ }
+} {1 2 3}
+do_test limit-9.4 {
+ execsql {
+ SELECT * FROM (SELECT * FROM t6 LIMIT 3)
+ UNION
+ SELECT * FROM (SELECT * FROM t7 LIMIT 3)
+ ORDER BY 1
+ LIMIT 2
+ }
+} {1 2}
+
finish_test