SQLite

Check-in [9ffff3d052]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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 SqlLogicTest during release testing for version 3.7.17.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ffff3d05226bbd01a0745dd0a511776358253c0
User & Date: drh 2013-05-16 01:02:45.632
Context
2013-05-16
11:57
In sqlite3_close_v2(), do not attempt to roll back a transaction if there exist active statement objects. Any open transaction will be rolled back when the last of these statement objects is finalized. (check-in: d11e76072a user: dan tags: trunk)
01:02
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 SqlLogicTest during release testing for version 3.7.17. (check-in: 9ffff3d052 user: drh tags: trunk)
2013-05-15
20:35
Apply compilation fix from [a58af81483] to the other makefiles as well. (check-in: 7e76889d67 user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/resolve.c.
1155
1156
1157
1158
1159
1160
1161
1162
1163

1164
1165
1166
1167
1168
1169
1170
    ** expressions in the WHERE clause (etc.) can refer to expressions by
    ** aliases in the result set.
    **
    ** Minor point: If this is the case, then the expression will be
    ** 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->pWhere) ) return WRC_Abort;
    sNC.ncFlags &= ~NC_AsMaybe;

    /* The ORDER BY and GROUP BY clauses may not refer to terms in
    ** outer queries 
    */
    sNC.pNext = 0;







<

>







1155
1156
1157
1158
1159
1160
1161

1162
1163
1164
1165
1166
1167
1168
1169
1170
    ** expressions in the WHERE clause (etc.) can refer to expressions by
    ** aliases in the result set.
    **
    ** Minor point: If this is the case, then the expression will be
    ** re-evaluated for each reference to it.
    */
    sNC.pEList = p->pEList;

    sNC.ncFlags |= NC_AsMaybe;
    if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
    if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
    sNC.ncFlags &= ~NC_AsMaybe;

    /* The ORDER BY and GROUP BY clauses may not refer to terms in
    ** outer queries 
    */
    sNC.pNext = 0;