1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Treat identifiers in the HAVING clause the same as in the WHERE clause.

Only consider AS names from the result set to match if there are no other
matches.  Continuation of the fix for [2500cdb9be05].  This check-in
fixes a bug found by [http://www.sqlite.org/sqllogictest/ | SqlLogicTest]
during release testing for version 3.7.17.

FossilOrigin-Name: 9ffff3d05226bbd01a0745dd0a511776358253c0
This commit is contained in:
drh
2013-05-16 01:02:45 +00:00
parent 0600663346
commit 58a450c041
3 changed files with 9 additions and 9 deletions

View File

@@ -1159,8 +1159,8 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
** re-evaluated for each reference to it.
*/
sNC.pEList = p->pEList;
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
sNC.ncFlags |= NC_AsMaybe;
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
sNC.ncFlags &= ~NC_AsMaybe;