aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-08-26 20:41:33 +0000
committerdrh <drh@noemail.net>2019-08-26 20:41:33 +0000
commit512e46a74c20c0e385ee798a6e3238ba1cc621b8 (patch)
tree7d7d75a2c3449b6f332d8131c47f1c8d8434af3f /src/expr.c
parentee6c5e5ae7193241a55dd83c8f434a5d7c5abf11 (diff)
parentd790c9a1613334e2fc6b92211911e032ecbf36cf (diff)
downloadsqlite-512e46a74c20c0e385ee798a6e3238ba1cc621b8.tar.gz
sqlite-512e46a74c20c0e385ee798a6e3238ba1cc621b8.zip
Merge in recent fixes from trunk.
FossilOrigin-Name: ad816d01d4bd3908ff2c574d79d1a29b6d732df308f2f1b1cdf7c0bc7c1bd7cf
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c
index d19ee92a0..7681ea69d 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1633,6 +1633,10 @@ ExprList *sqlite3ExprListAppendVector(
for(i=0; i<pColumns->nId; i++){
Expr *pSubExpr = sqlite3ExprForVectorField(pParse, pExpr, i);
+ assert( pSubExpr!=0 || db->mallocFailed );
+ assert( pSubExpr==0 || pSubExpr->iTable==0 );
+ if( pSubExpr==0 ) continue;
+ pSubExpr->iTable = pColumns->nId;
pList = sqlite3ExprListAppend(pParse, pList, pSubExpr);
if( pList ){
assert( pList->nExpr==iFirst+i+1 );
@@ -2879,7 +2883,7 @@ void sqlite3CodeRhsOfIN(
**
** The pExpr parameter is the SELECT or EXISTS operator to be coded.
**
-** The register that holds the result. For a multi-column SELECT,
+** Return the register that holds the result. For a multi-column SELECT,
** the result is stored in a contiguous array of registers and the
** return value is the register of the left-most result column.
** Return 0 if an error occurs.
@@ -3926,8 +3930,8 @@ expr_code_doover:
pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft);
}
assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT );
- if( pExpr->iTable
- && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft))
+ if( pExpr->iTable!=0
+ && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft))
){
sqlite3ErrorMsg(pParse, "%d columns assigned %d values",
pExpr->iTable, n);