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

Subquery flattening is implemented and passes all regression tests.

We still need to add addition tests to the suite to further exercise
the flattener, however. (CVS 408)

FossilOrigin-Name: d5d3e79cc58da5bd315cc1fea1f7cbf46274da16
This commit is contained in:
drh
2002-03-02 17:04:07 +00:00
parent 567c604bb5
commit 832508b7ea
14 changed files with 416 additions and 216 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.96 2002/02/28 00:41:11 drh Exp $
** @(#) $Id: sqliteInt.h,v 1.97 2002/03/02 17:04:08 drh Exp $
*/
#include "sqlite.h"
#include "hash.h"
@@ -434,6 +434,8 @@ struct WhereInfo {
int iBreak; /* Jump here to break out of the loop */
int base; /* Index of first Open opcode */
int nLevel; /* Number of nested loop */
int savedNTab; /* Value of pParse->nTab before WhereBegin() */
int peakNTab; /* Value of pParse->nTab after WhereBegin() */
WhereLevel a[1]; /* Information about each nest loop in the WHERE */
};
@@ -461,6 +463,7 @@ struct Select {
Select *pPrior; /* Prior select in a compound select statement */
int nLimit, nOffset; /* LIMIT and OFFSET values. -1 means not used */
char *zSelect; /* Complete text of the SELECT command */
int base; /* Index of VDBE cursor for left-most FROM table */
};
/*
@@ -521,7 +524,7 @@ struct Parse {
int nameClash; /* A permanent table name clashes with temp table name */
int newTnum; /* Table number to use when reparsing CREATE TABLEs */
int nErr; /* Number of errors seen */
int nTab; /* Number of previously allocated cursors */
int nTab; /* Number of previously allocated VDBE cursors */
int nMem; /* Number of memory cells used so far */
int nSet; /* Number of sets used so far */
int nAgg; /* Number of aggregate expressions */
@@ -586,7 +589,7 @@ void sqliteIdListAddAlias(IdList*, Token*);
void sqliteIdListDelete(IdList*);
void sqliteCreateIndex(Parse*, Token*, Token*, IdList*, int, Token*, Token*);
void sqliteDropIndex(Parse*, Token*);
int sqliteSelect(Parse*, Select*, int, int);
int sqliteSelect(Parse*, Select*, int, int, Select*, int, int);
Select *sqliteSelectNew(ExprList*,IdList*,Expr*,ExprList*,Expr*,ExprList*,
int,int,int);
void sqliteSelectDelete(Select*);
@@ -595,7 +598,7 @@ Table *sqliteTableNameToTable(Parse*, const char*);
IdList *sqliteTableTokenToIdList(Parse*, Token*);
void sqliteDeleteFrom(Parse*, Token*, Expr*);
void sqliteUpdate(Parse*, Token*, ExprList*, Expr*, int);
WhereInfo *sqliteWhereBegin(Parse*, IdList*, Expr*, int);
WhereInfo *sqliteWhereBegin(Parse*, int, IdList*, Expr*, int);
void sqliteWhereEnd(WhereInfo*);
void sqliteExprCode(Parse*, Expr*);
void sqliteExprIfTrue(Parse*, Expr*, int);
@@ -611,8 +614,7 @@ char *sqliteTableNameFromToken(Token*);
int sqliteExprCheck(Parse*, Expr*, int, int*);
int sqliteExprCompare(Expr*, Expr*);
int sqliteFuncId(Token*);
int sqliteExprResolveIds(Parse*, IdList*, ExprList*, Expr*);
void sqliteExprResolveInSelect(Parse*, Expr*);
int sqliteExprResolveIds(Parse*, int, IdList*, ExprList*, Expr*);
int sqliteExprAnalyzeAggregates(Parse*, Expr*);
Vdbe *sqliteGetVdbe(Parse*);
int sqliteRandomByte(void);