mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Give the EXISTS-to-IN optimization the ability to handle some cases that
involve vector comparisons, instead of throwing a mysterious error in those cases. FossilOrigin-Name: 87e78a19bb3ae1caf57aeeae53a5ab4efdccb57265f25d5c19b62eae53747aff
This commit is contained in:
@@ -1215,16 +1215,24 @@ static void exprAnalyzeExists(
|
||||
if( pInLhs==pEq->pLeft ){
|
||||
pRet = pEq->pRight;
|
||||
}else{
|
||||
CollSeq *p = sqlite3ExprCompareCollSeq(pParse, pEq);
|
||||
pInLhs = sqlite3ExprAddCollateString(pParse, pInLhs, p?p->zName:"BINARY");
|
||||
pRet = pEq->pLeft;
|
||||
if( pRet->op!=TK_VECTOR ){
|
||||
CollSeq *p = sqlite3ExprCompareCollSeq(pParse, pEq);
|
||||
pInLhs = sqlite3ExprAddCollateString(pParse, pInLhs, p?p->zName:"BINARY");
|
||||
}
|
||||
}
|
||||
|
||||
assert( pDup->pLeft==0 );
|
||||
pDup->op = TK_IN;
|
||||
pDup->pLeft = pInLhs;
|
||||
pDup->flags &= ~EP_VarSelect;
|
||||
pSel->pEList = sqlite3ExprListAppend(pParse, 0, pRet);
|
||||
if( pRet->op==TK_VECTOR ){
|
||||
pSel->pEList = pRet->x.pList;
|
||||
pRet->x.pList = 0;
|
||||
sqlite3ExprDelete(db, pRet);
|
||||
}else{
|
||||
pSel->pEList = sqlite3ExprListAppend(pParse, 0, pRet);
|
||||
}
|
||||
pEq->pLeft = 0;
|
||||
pEq->pRight = 0;
|
||||
if( ppAnd ){
|
||||
|
||||
Reference in New Issue
Block a user