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

Fixes for problems following OOM errors.

FossilOrigin-Name: 9041ee4a6f0e8389297f887f1431ab5cfe783390
This commit is contained in:
drh
2016-08-20 18:06:14 +00:00
parent 9854260bca
commit 8bd0d58e1c
4 changed files with 20 additions and 13 deletions

View File

@@ -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;