-C Fixes\sfor\sproblems\sfollowing\sOOM\serrors.
-D 2016-08-20T18:06:14.286
+C Clarification\sof\scode\scomments\sin\sexpr.c.\s\sClean\sup\sthe\simplementations\nof\ssqlite3ExprIsVector()\sand\ssqlite3ExprVectorSize()\sslightly.
+D 2016-08-20T21:02:38.224
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
F src/date.c 95c9a8d00767e7221a8e9a31f4e913fc8029bf6b
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
F src/delete.c 76c084f0265f4a3cd1ecf17eee112a94f1ccbc05
-F src/expr.c e96f29a02a3927b2afaca1f86fc84e80cac50ca7
+F src/expr.c 4adf875e1bfc155b107ee8e35e7cb1c5599f955b
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c e2be0968c1adc679c87e467aa5b4f167588f38a8
F src/func.c 29cc9acb170ec1387b9f63eb52cd85f8de96c771
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 8384c77ebb3f65fbc54c199885926f2066f0b140
-R d29ab3049f2812696918a926abccb285
+P 9041ee4a6f0e8389297f887f1431ab5cfe783390
+R bba779342591015bf7eda1fee0ab13af
U drh
-Z 08f6ec095045e30304bec0161a676b54
+Z 030a18789c82832c6d203bdc6c28c7db
** Return true if expression pExpr is a vector, or false otherwise.
*/
int sqlite3ExprIsVector(Expr *pExpr){
- return ( (pExpr->op==TK_VECTOR)
- || (pExpr->op==TK_SELECT && pExpr->x.pSelect->pEList->nExpr>1)
- );
+ return sqlite3ExprVectorSize(pExpr)>1;
}
/*
** any other type of expression, return 1.
*/
int sqlite3ExprVectorSize(Expr *pExpr){
- if( sqlite3ExprIsVector(pExpr)==0 ) return 1;
- if( pExpr->flags & EP_xIsSelect ){
+ if( pExpr->op==TK_VECTOR ){
+ return pExpr->x.pList->nExpr;
+ }else if( pExpr->op==TK_SELECT ){
return pExpr->x.pSelect->pEList->nExpr;
+ }else{
+ return 1;
}
- return pExpr->x.pList->nExpr;
}
#ifndef SQLITE_OMIT_SUBQUERY
/*
-** Interpret the pVector input as a vector expression. If pVector is
-** an ordinary scalar expression, treat it as a vector of size 1.
-**
** Return a pointer to a subexpression of pVector that is the i-th
** column of the vector (numbered starting with 0). The caller must
** ensure that i is within range.
**
+** If pVector is really a scalar (and "scalar" here includes subqueries
+** that return a single column!) then return pVector unmodified.
+**
** pVector retains ownership of the returned subexpression.
**
** If the vector is a (SELECT ...) then the expression returned is
-** just the expression for the i-th term of the result set, and is
-** necessarily ready to be evaluated because the table cursor might
-** not have been positioned yet.
+** just the expression for the i-th term of the result set, and may
+** not be ready for evaluation because the table cursor has not yet
+** been positioned.
*/
Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){
assert( i<sqlite3ExprVectorSize(pVector) );
** ensuring that the returned value eventually gets freed.
**
** The caller retains ownership of pVector. If pVector is a TK_SELECT,
-** then the return value will reference pVector and so pVector must remain
+** then the returne object will reference pVector and so pVector must remain
** valid for the life of the returned object. If pVector is a TK_VECTOR
** or a scalar expression, then it can be deleted as soon as this routine
-** routines.
+** returns.
**
** A trick to cause a TK_SELECT pVector to be deleted together with
** the returned Expr object is to attach the pVector to the pRight field