1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

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
This commit is contained in:
drh
2008-08-29 02:14:02 +00:00
parent 3fb120cb9d
commit 8b213899e8
8 changed files with 285 additions and 51 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
** $Id: delete.c,v 1.173 2008/08/22 12:30:52 drh Exp $
** $Id: delete.c,v 1.174 2008/08/29 02:14:03 drh Exp $
*/
#include "sqliteInt.h"
@@ -104,8 +104,8 @@ void sqlite3MaterializeView(
Token viewName;
pWhere = sqlite3ExprDup(db, pWhere);
viewName.z = pView->zName;
viewName.n = strlen(viewName.z);
viewName.z = (u8*)pView->zName;
viewName.n = (unsigned int)strlen((const char*)viewName.z);
pFrom = sqlite3SrcListAppendFromTerm(pParse, 0, 0, 0, &viewName, pDup, 0,0);
pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0);
}