diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 8 | ||||
-rw-r--r-- | src/select.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index 12c94362f..606a4cd7e 100644 --- a/src/expr.c +++ b/src/expr.c @@ -73,7 +73,9 @@ char sqlite3ExprAffinity(const Expr *pExpr){ pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr ); } - if( op==TK_VECTOR ){ + if( op==TK_VECTOR + || (op==TK_FUNCTION && pExpr->affExpr==SQLITE_AFF_DEFER) + ){ assert( ExprUseXList(pExpr) ); return sqlite3ExprAffinity(pExpr->x.pList->a[0].pExpr); } @@ -266,7 +268,9 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){ p = p->pLeft; continue; } - if( op==TK_VECTOR ){ + if( op==TK_VECTOR + || (op==TK_FUNCTION && p->affExpr==SQLITE_AFF_DEFER) + ){ assert( ExprUseXList(p) ); p = p->x.pList->a[0].pExpr; continue; diff --git a/src/select.c b/src/select.c index 1525a4640..6c0e7c92d 100644 --- a/src/select.c +++ b/src/select.c @@ -631,7 +631,7 @@ static int sqlite3ProcessJoin(Parse *pParse, Select *p){ pFuncArgs = sqlite3ExprListAppend(pParse, pFuncArgs, pE1); pE1 = sqlite3ExprFunction(pParse, pFuncArgs, &tkCoalesce, 0); if( pE1 ){ - pE1->affExpr = sqlite3ExprAffinity(pFuncArgs->a[0].pExpr); + pE1->affExpr = SQLITE_AFF_DEFER; } } }else if( (pSrc->a[i+1].fg.jointype & JT_LEFT)!=0 && pParse->nErr==0 ){ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 951cd3d34..c65d159d1 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2329,6 +2329,7 @@ struct CollSeq { #define SQLITE_AFF_INTEGER 0x44 /* 'D' */ #define SQLITE_AFF_REAL 0x45 /* 'E' */ #define SQLITE_AFF_FLEXNUM 0x46 /* 'F' */ +#define SQLITE_AFF_DEFER 0x58 /* 'X' - defer computation until later */ #define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC) |