aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-04-23 13:37:05 +0000
committerdrh <drh@noemail.net>2015-04-23 13:37:05 +0000
commit41148f83c47b0d196f9d11aaad89d3528ecb4830 (patch)
tree0aada9c60e4b1a5a07385e4f6c1b2e183d360206 /src
parent00808deed0fa19953cded0d5d76076e451f2db7e (diff)
downloadsqlite-41148f83c47b0d196f9d11aaad89d3528ecb4830.tar.gz
sqlite-41148f83c47b0d196f9d11aaad89d3528ecb4830.zip
Fix a faulty assert() in the "AS" alias resolution logic of the parser.
FossilOrigin-Name: b5e43602833249aa4b73337bf85b7f308450dab6
Diffstat (limited to 'src')
-rw-r--r--src/resolve.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 32e0a98fd..b75db42ef 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -79,7 +79,7 @@ static void incrAggFunctionDepth(Expr *pExpr, int N){
** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
**
** The nSubquery parameter specifies how many levels of subquery the
-** alias is removed from the original expression. The usually value is
+** alias is removed from the original expression. The usual value is
** zero but it might be more if the alias is contained within a subquery
** of the original expression. The Expr.op2 field of TK_AGG_FUNCTION
** structures must be increased by the nSubquery amount.
@@ -99,7 +99,7 @@ static void resolveAlias(
assert( iCol>=0 && iCol<pEList->nExpr );
pOrig = pEList->a[iCol].pExpr;
assert( pOrig!=0 );
- assert( pOrig->flags & EP_Resolved );
+ assert( (pOrig->flags & EP_Resolved)!=0 || zType[0]==0 );
db = pParse->db;
pDup = sqlite3ExprDup(db, pOrig, 0);
if( pDup==0 ) return;