Remove the EP_Vector expression flag.
FossilOrigin-Name: e9d9c6d46b46160fad6aa6e3441a65a09157515f
This commit is contained in:
parent
19ff12dd76
commit
625015e0c9
20
manifest
20
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\ssome\sissues\swith\svector\srange\sconstraints\sand\sthe\scolumn\scache.\sAlso\svector\srange\sconstraints\sand\srowid\scolumns.
|
||||
D 2016-07-29T20:58:19.781
|
||||
C Remove\sthe\sEP_Vector\sexpression\sflag.
|
||||
D 2016-07-30T16:39:28.446
|
||||
F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
|
||||
@ -337,7 +337,7 @@ F src/ctime.c 61949e83c4c36e37195a8398ebc752780b534d95
|
||||
F src/date.c 1cc9fb516ec9932c6fd4d2a0d2f8bc4480145c39
|
||||
F src/dbstat.c 4f6f7f52b49beb9636ffbd517cfe44a402ba4ad0
|
||||
F src/delete.c 4aba4214a377ce8ddde2d2e609777bcc8235200f
|
||||
F src/expr.c d904598a807ec20500a987566b453307cf2552cd
|
||||
F src/expr.c 4e79d7a355a59d5d0635f0a718a07abf21fe69bc
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c bc4145347595b7770f9a598cff1c848302cf5413
|
||||
F src/func.c 61a4114cf7004f10c542cfabbab9f2bcb9033045
|
||||
@ -381,14 +381,14 @@ F src/pragma.h 64c78a648751b9f4f297276c4eb7507b14b4628c
|
||||
F src/prepare.c 22df6171aec1d86904ed2ad30c2348a5748aa04e
|
||||
F src/printf.c a5f0ca08ddede803c241266abb46356ec748ded1
|
||||
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c d5516a3818748c50f98c18e4601a746e90929f1c
|
||||
F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598
|
||||
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
|
||||
F src/select.c 0115f5d222f5cf9b5511ec4072088417354d738a
|
||||
F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5
|
||||
F src/sqlite.h.in c6e68a4a47610631822a4f8f83a44c9f75339331
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 46f300b6e300e0fa916d7d58c44b53415b8471a9
|
||||
F src/sqliteInt.h 65473a83bccce3556425f764900cb1b716b6cfa1
|
||||
F src/sqliteInt.h 618346a0ad21589a177aeaa3725a6dfe0b2dbcf3
|
||||
F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
|
||||
F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab
|
||||
F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
|
||||
@ -465,8 +465,8 @@ F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2
|
||||
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
|
||||
F src/where.c df58d6ad7878a08aa96c652ccbc6d0949f8fa472
|
||||
F src/whereInt.h 14dd243e13b81cbb0a66063d38b70f93a7d6e613
|
||||
F src/wherecode.c e3159b1d6ecd2d39f99f3ec7926d02c1f04f3053
|
||||
F src/whereexpr.c c63e0e48fe32eeb99c0d32e4130ae56af80fcbf5
|
||||
F src/wherecode.c 6131be0cb19702665c3decbf243dae58ecc15937
|
||||
F src/whereexpr.c 82196ee82ca9de9d133ae742786bb89cf6ee890d
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
|
||||
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
@ -1512,7 +1512,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 4dfebff2924f46284d5b9cda69175f79b29d6028
|
||||
R 6db81bb19ebb4412c650189f8ab65d8e
|
||||
P 42607366bfc2dceb1013797a973b3b8df75dcb4d
|
||||
R eaef7077e544c307dde0b934686aad76
|
||||
U dan
|
||||
Z 49cec86004a136f8782fa45723e38de1
|
||||
Z c4dca5e01854a7cf15bed46750135eb4
|
||||
|
@ -1 +1 @@
|
||||
42607366bfc2dceb1013797a973b3b8df75dcb4d
|
||||
e9d9c6d46b46160fad6aa6e3441a65a09157515f
|
23
src/expr.c
23
src/expr.c
@ -316,13 +316,23 @@ static int codeCompare(
|
||||
** any other type of expression, return 1.
|
||||
*/
|
||||
int sqlite3ExprVectorSize(Expr *pExpr){
|
||||
if( (pExpr->flags & EP_Vector)==0 ) return 1;
|
||||
if( sqlite3ExprIsVector(pExpr)==0 ) return 1;
|
||||
if( pExpr->flags & EP_xIsSelect ){
|
||||
return pExpr->x.pSelect->pEList->nExpr;
|
||||
}
|
||||
return pExpr->x.pList->nExpr;
|
||||
}
|
||||
|
||||
/*
|
||||
** 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)
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
** If the expression passed as the first argument is a TK_VECTOR, return
|
||||
** a pointer to the i'th field of the vector. Or, if the first argument
|
||||
@ -330,7 +340,7 @@ int sqlite3ExprVectorSize(Expr *pExpr){
|
||||
** value. Otherwise, return a copy of the first argument.
|
||||
*/
|
||||
static Expr *exprVectorField(Expr *pVector, int i){
|
||||
if( (pVector->flags & EP_Vector)==0 ){
|
||||
if( sqlite3ExprIsVector(pVector)==0 ){
|
||||
assert( i==0 );
|
||||
return pVector;
|
||||
}else if( pVector->flags & EP_xIsSelect ){
|
||||
@ -3171,7 +3181,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
case TK_NE:
|
||||
case TK_EQ: {
|
||||
Expr *pLeft = pExpr->pLeft;
|
||||
if( (pLeft->flags & EP_Vector) ){
|
||||
if( sqlite3ExprIsVector(pLeft) ){
|
||||
codeVectorCompare(pParse, pExpr, target);
|
||||
}else{
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pLeft, ®Free1);
|
||||
@ -3865,7 +3875,7 @@ static void exprCodeBetween(
|
||||
compRight.op = TK_LE;
|
||||
compRight.pLeft = &exprX;
|
||||
compRight.pRight = pExpr->x.pList->a[1].pExpr;
|
||||
if( (exprX.flags & EP_Vector)==0 ){
|
||||
if( sqlite3ExprIsVector(&exprX)==0 ){
|
||||
exprToRegister(&exprX, sqlite3ExprCodeTemp(pParse, &exprX, ®Free1));
|
||||
}
|
||||
if( xJumpIf ){
|
||||
@ -3949,7 +3959,7 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
|
||||
case TK_GE:
|
||||
case TK_NE:
|
||||
case TK_EQ: {
|
||||
if( pExpr->pLeft->flags & EP_Vector ) goto default_expr;
|
||||
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr;
|
||||
testcase( jumpIfNull==0 );
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1);
|
||||
r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2);
|
||||
@ -4103,8 +4113,7 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
|
||||
case TK_GE:
|
||||
case TK_NE:
|
||||
case TK_EQ: {
|
||||
if( pExpr->pLeft->flags & EP_Vector ) goto default_expr;
|
||||
|
||||
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr;
|
||||
testcase( jumpIfNull==0 );
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1);
|
||||
r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2);
|
||||
|
@ -765,10 +765,6 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
ExprSetProperty(pExpr, EP_VarSelect);
|
||||
pNC->ncFlags |= NC_VarSelect;
|
||||
}
|
||||
|
||||
if( pExpr->op==TK_SELECT && pExpr->x.pSelect->pEList->nExpr>1 ){
|
||||
ExprSetProperty(pExpr, EP_Vector);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -776,11 +772,6 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
|
||||
break;
|
||||
}
|
||||
|
||||
case TK_VECTOR: {
|
||||
ExprSetProperty(pExpr, EP_Vector);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue;
|
||||
}
|
||||
|
@ -2327,7 +2327,6 @@ struct Expr {
|
||||
#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
|
||||
#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
|
||||
#define EP_Alias 0x400000 /* Is an alias for a result set column */
|
||||
#define EP_Vector 0x800000 /* This expression is a row value */
|
||||
|
||||
/*
|
||||
** Combinations of two or more EP_* flags
|
||||
@ -4256,5 +4255,6 @@ int sqlite3DbstatRegister(sqlite3*);
|
||||
#endif
|
||||
|
||||
int sqlite3ExprVectorSize(Expr *pExpr);
|
||||
int sqlite3ExprIsVector(Expr *pExpr);
|
||||
|
||||
#endif /* SQLITEINT_H */
|
||||
|
@ -952,7 +952,7 @@ static void codeDeferredSeek(
|
||||
|
||||
static void codeExprOrVector(Parse *pParse, Expr *p, int iReg, int nReg){
|
||||
assert( nReg>0 );
|
||||
if( p->flags & EP_Vector ){
|
||||
if( sqlite3ExprIsVector(p) ){
|
||||
int i;
|
||||
if( (p->flags & EP_xIsSelect)==0 ){
|
||||
ExprList *pList = p->x.pList;
|
||||
@ -1200,7 +1200,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
pX = pStart->pExpr;
|
||||
assert( pX!=0 );
|
||||
testcase( pStart->leftCursor!=iCur ); /* transitive constraints */
|
||||
if( pX->pRight->flags & EP_Vector ){
|
||||
if( sqlite3ExprIsVector(pX->pRight) ){
|
||||
r1 = rTemp = sqlite3GetTempReg(pParse);
|
||||
codeExprOrVector(pParse, pX->pRight, r1, 1);
|
||||
op = aMoveOp[(pX->op - TK_GT) | 0x0001];
|
||||
@ -1231,7 +1231,9 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
testcase( pEnd->wtFlags & TERM_VIRTUAL );
|
||||
memEndValue = ++pParse->nMem;
|
||||
codeExprOrVector(pParse, pX->pRight, memEndValue, 1);
|
||||
if( !(pX->pRight->flags&EP_Vector) && (pX->op==TK_LT || pX->op==TK_GT) ){
|
||||
if( 0==sqlite3ExprIsVector(pX->pRight)
|
||||
&& (pX->op==TK_LT || pX->op==TK_GT)
|
||||
){
|
||||
testOp = bRev ? OP_Le : OP_Ge;
|
||||
}else{
|
||||
testOp = bRev ? OP_Lt : OP_Gt;
|
||||
@ -1440,7 +1442,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
}
|
||||
nConstraint += nBtm;
|
||||
testcase( pRangeStart->wtFlags & TERM_VIRTUAL );
|
||||
if( (pRight->flags & EP_Vector)==0 ){
|
||||
if( sqlite3ExprIsVector(pRight)==0 ){
|
||||
disableTerm(pLevel, pRangeStart);
|
||||
}else{
|
||||
startEq = 1;
|
||||
@ -1493,7 +1495,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
nConstraint += nTop;
|
||||
testcase( pRangeEnd->wtFlags & TERM_VIRTUAL );
|
||||
|
||||
if( (pRight->flags & EP_Vector)==0 ){
|
||||
if( sqlite3ExprIsVector(pRight)==0 ){
|
||||
disableTerm(pLevel, pRangeEnd);
|
||||
}else{
|
||||
endEq = 1;
|
||||
|
@ -845,9 +845,7 @@ static int exprMightBeIndexed(
|
||||
** inequality constraint (>, <, >= or <=), perform the processing
|
||||
** on the first element of the vector. */
|
||||
assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE );
|
||||
if( (pExpr->flags & (EP_Vector|EP_xIsSelect))==EP_Vector
|
||||
&& (op>=TK_GT && op<=TK_GE)
|
||||
){
|
||||
if( pExpr->op==TK_VECTOR && (op>=TK_GT && op<=TK_GE) ){
|
||||
pExpr = pExpr->x.pList->a[0].pExpr;
|
||||
}
|
||||
|
||||
@ -1186,7 +1184,7 @@ static void exprAnalyze(
|
||||
|
||||
if( pWC->op==TK_AND
|
||||
&& (pExpr->op==TK_EQ || pExpr->op==TK_IS)
|
||||
&& (pExpr->pLeft->flags & EP_Vector)
|
||||
&& sqlite3ExprIsVector(pExpr->pLeft)
|
||||
&& ( (pExpr->pLeft->flags & EP_xIsSelect)==0
|
||||
|| (pExpr->pRight->flags & EP_xIsSelect)==0
|
||||
)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user