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

Previous check-in to fix [b47e3627ecaadbde] was incomplete. This check-in

completes the fix and adds a test cases.

FossilOrigin-Name: c7da1c01f1f239e68c2173ac5748b8c5798271e43bdcee68f51f97cd0ca92bd5
This commit is contained in:
drh
2019-10-22 11:29:22 +00:00
parent a5d0911546
commit 98c94e60d0
4 changed files with 29 additions and 10 deletions

View File

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