aboutsummaryrefslogtreecommitdiff
path: root/src/whereexpr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-10-22 11:29:22 +0000
committerdrh <drh@noemail.net>2019-10-22 11:29:22 +0000
commit98c94e60d0b6a59c63cb0618be8307d34e3b97a6 (patch)
tree1e3879116db945227a832f0aa637baf189096a72 /src/whereexpr.c
parenta5d0911546c0d41f142a33fc3622df7ef7d8a81d (diff)
downloadsqlite-98c94e60d0b6a59c63cb0618be8307d34e3b97a6.tar.gz
sqlite-98c94e60d0b6a59c63cb0618be8307d34e3b97a6.zip
Previous check-in to fix [b47e3627ecaadbde] was incomplete. This check-in
completes the fix and adds a test cases. FossilOrigin-Name: c7da1c01f1f239e68c2173ac5748b8c5798271e43bdcee68f51f97cd0ca92bd5
Diffstat (limited to 'src/whereexpr.c')
-rw-r--r--src/whereexpr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/whereexpr.c b/src/whereexpr.c
index ea174e1f3..7daf7508c 100644
--- a/src/whereexpr.c
+++ b/src/whereexpr.c
@@ -111,8 +111,11 @@ static int allowedOp(int op){
** are converted into "Y op X".
*/
static u16 exprCommute(Parse *pParse, Expr *pExpr){
- if( sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight) !=
- sqlite3BinaryCompareCollSeq(pParse, pExpr->pRight, pExpr->pLeft) ){
+ if( pExpr->pLeft->op==TK_VECTOR
+ || pExpr->pRight->op==TK_VECTOR
+ || sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight) !=
+ sqlite3BinaryCompareCollSeq(pParse, pExpr->pRight, pExpr->pLeft)
+ ){
pExpr->flags ^= EP_Commuted;
}
SWAP(Expr*,pExpr->pRight,pExpr->pLeft);