1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix the LIMIT clause so that it applies to the entire query in a compound

query.  Prior to this change LIMITs on compound queries did not work at
all.  Ticket #393. (CVS 1058)

FossilOrigin-Name: 543479e3aed77976a0c689cf40811bf88353f706
This commit is contained in:
drh
2003-07-20 01:16:46 +00:00
parent e5f50722b4
commit 7b58daeafe
7 changed files with 198 additions and 63 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.193 2003/06/23 11:06:02 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.194 2003/07/20 01:16:47 drh Exp $
*/
#include "config.h"
#include "sqlite.h"
@@ -778,16 +778,17 @@ struct WhereInfo {
** in the VDBE that record the limit and offset counters.
*/
struct Select {
int isDistinct; /* True if the DISTINCT keyword is present */
ExprList *pEList; /* The fields of the result */
u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */
u8 isDistinct; /* True if the DISTINCT keyword is present */
SrcList *pSrc; /* The FROM clause */
Expr *pWhere; /* The WHERE clause */
ExprList *pGroupBy; /* The GROUP BY clause */
Expr *pHaving; /* The HAVING clause */
ExprList *pOrderBy; /* The ORDER BY clause */
int op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */
Select *pPrior; /* Prior select in a compound select statement */
int nLimit, nOffset; /* LIMIT and OFFSET values. -1 means not used */
int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
char *zSelect; /* Complete text of the SELECT command */
};