diff options
author | drh <drh@noemail.net> | 2016-08-20 18:06:14 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-08-20 18:06:14 +0000 |
commit | 8bd0d58e1c5e66c5109435bf86c24f9d0b71130f (patch) | |
tree | 2e712b7231030224b295d828e5ed5015f9a230ea /src/expr.c | |
parent | 9854260bcaa2c049e9d323a39a44f7d75365c820 (diff) | |
download | sqlite-8bd0d58e1c5e66c5109435bf86c24f9d0b71130f.tar.gz sqlite-8bd0d58e1c5e66c5109435bf86c24f9d0b71130f.zip |
Fixes for problems following OOM errors.
FossilOrigin-Name: 9041ee4a6f0e8389297f887f1431ab5cfe783390
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index bd2426add..ac67eca69 100644 --- a/src/expr.c +++ b/src/expr.c @@ -406,8 +406,11 @@ Expr *sqlite3ExprForVectorField( ** with the same pLeft pointer to the pVector, but only one of them ** will own the pVector. */ - pRet = sqlite3PExpr(pParse, TK_SELECT_COLUMN, pVector, 0, 0); - if( pRet ) pRet->iColumn = iField; + pRet = sqlite3PExpr(pParse, TK_SELECT_COLUMN, 0, 0, 0); + if( pRet ){ + pRet->iColumn = iField; + pRet->pLeft = pVector; + } assert( pRet==0 || pRet->iTable==0 ); }else{ if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr; @@ -462,7 +465,8 @@ static int exprVectorRegister( int *pRegFree /* OUT: Temp register to free */ ){ assert( pVector->op==TK_VECTOR || pVector->op==TK_SELECT ); - assert( pParse->nErr || (pVector->op==TK_VECTOR)==(regSelect==0) ); + assert( pParse->nErr || pParse->db->mallocFailed + || (pVector->op==TK_VECTOR)==(regSelect==0) ); if( pVector->op==TK_SELECT ){ *ppExpr = pVector->x.pSelect->pEList->a[iField].pExpr; return regSelect+iField; |