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

Changes toward fixes for tickets #2296 and #2291. (CVS 3838)

FossilOrigin-Name: 0dd3e2e47b09156838edfa4dea0d82f9cf22d94d
This commit is contained in:
drh
2007-04-12 21:25:01 +00:00
parent 6c1426fd14
commit 994c80af27
4 changed files with 18 additions and 15 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.334 2007/04/12 03:54:39 drh Exp $
** $Id: select.c,v 1.335 2007/04/12 21:25:02 drh Exp $
*/
#include "sqliteInt.h"
@@ -2591,12 +2591,15 @@ int sqlite3SelectResolve(
*/
sNC.pEList = p->pEList;
if( sqlite3ExprResolveNames(&sNC, p->pWhere) ||
sqlite3ExprResolveNames(&sNC, p->pHaving) ||
processOrderGroupBy(&sNC, p->pOrderBy, "ORDER") ||
processOrderGroupBy(&sNC, pGroupBy, "GROUP")
){
sqlite3ExprResolveNames(&sNC, p->pHaving) ){
return SQLITE_ERROR;
}
if( p->pPrior==0 ){
if( processOrderGroupBy(&sNC, p->pOrderBy, "ORDER") ||
processOrderGroupBy(&sNC, pGroupBy, "GROUP") ){
return SQLITE_ERROR;
}
}
/* Make sure the GROUP BY clause does not contain aggregate functions.
*/