diff options
author | drh <drh@noemail.net> | 2008-08-29 02:14:02 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-08-29 02:14:02 +0000 |
commit | 8b213899e804561fe1df90dc1f9f32a165d563ab (patch) | |
tree | 3ec0a887a739708058bd73ff4ed323eb554828f9 /src/sqliteInt.h | |
parent | 3fb120cb9d4118e59304dfb9f3abaec7806e8597 (diff) | |
download | sqlite-8b213899e804561fe1df90dc1f9f32a165d563ab.tar.gz sqlite-8b213899e804561fe1df90dc1f9f32a165d563ab.zip |
Avoid reevaluating WHERE and ORDER BY expressions that alias terms in the
result set. Ticket #3343. Note that aliased GROUP BY expressions are still
evaluated twice. (CVS 5637)
FossilOrigin-Name: ab0292caa5887cc1bdc0e8c9d3f3502b83975440
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d66036ba2..b41104a0f 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.761 2008/08/22 17:34:45 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.762 2008/08/29 02:14:03 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -1345,6 +1345,7 @@ struct ExprList { u8 sortOrder; /* 1 for DESC or 0 for ASC */ u8 done; /* A flag to indicate when processing is finished */ u16 iCol; /* For ORDER BY, column number in result set */ + u16 iAlias; /* Index into Parse.aAlias[] for zName */ } *a; /* One entry for each expression */ }; @@ -1681,6 +1682,8 @@ struct Parse { int nVarExpr; /* Number of used slots in apVarExpr[] */ int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */ Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */ + int nAlias; /* Number of aliased result set columns */ + int *aAlias; /* Register used to hold aliased result */ u8 explain; /* True if the EXPLAIN flag is found on the query */ Token sErrToken; /* The token at which the error occurred */ Token sNameToken; /* Token with unqualified schema object name */ |