1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Correct names returned from a query against a view. Ticket #1709, #1688, #1711. (CVS 3128)

FossilOrigin-Name: 36830fafa405c9eae4795045efc6843394c67555
This commit is contained in:
drh
2006-03-09 17:28:12 +00:00
parent 86b7f57555
commit 643054c18b
4 changed files with 26 additions and 11 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.306 2006/03/06 20:55:46 drh Exp $
** $Id: select.c,v 1.307 2006/03/09 17:28:12 drh Exp $
*/
#include "sqliteInt.h"
@@ -2243,7 +2243,6 @@ static int flattenSubquery(
** We look at every expression in the outer query and every place we see
** "a" we substitute "x*3" and every place we see "b" we substitute "y+10".
*/
substExprList(p->pEList, iParent, pSub->pEList);
pList = p->pEList;
for(i=0; i<pList->nExpr; i++){
Expr *pExpr;
@@ -2251,6 +2250,7 @@ static int flattenSubquery(
pList->a[i].zName = sqliteStrNDup((char*)pExpr->span.z, pExpr->span.n);
}
}
substExprList(p->pEList, iParent, pSub->pEList);
if( isAgg ){
substExprList(p->pGroupBy, iParent, pSub->pEList);
substExpr(p->pHaving, iParent, pSub->pEList);