mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Improved handling of vector equalities in the EXISTS-to-IN translator.
FossilOrigin-Name: ef49ee4a3766146963bfb6b013472f9836afb9c5b0d21a8533871cf961139e38
This commit is contained in:
13
src/expr.c
13
src/expr.c
@@ -95,7 +95,18 @@ Expr *sqlite3ExprAddCollateToken(
|
||||
const Token *pCollName, /* Name of collating sequence */
|
||||
int dequote /* True to dequote pCollName */
|
||||
){
|
||||
if( pCollName->n>0 ){
|
||||
assert( pExpr!=0 || pParse->db->mallocFailed );
|
||||
if( pExpr==0 ) return 0;
|
||||
if( pExpr->op==TK_VECTOR ){
|
||||
ExprList *pList = pExpr->x.pList;
|
||||
if( ALWAYS(pList!=0) ){
|
||||
int i;
|
||||
for(i=0; i<pList->nExpr; i++){
|
||||
pList->a[i].pExpr = sqlite3ExprAddCollateToken(pParse,pList->a[i].pExpr,
|
||||
pCollName, dequote);
|
||||
}
|
||||
}
|
||||
}else if( pCollName->n>0 ){
|
||||
Expr *pNew = sqlite3ExprAlloc(pParse->db, TK_COLLATE, pCollName, dequote);
|
||||
if( pNew ){
|
||||
pNew->pLeft = pExpr;
|
||||
|
||||
@@ -1215,11 +1215,9 @@ 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 );
|
||||
|
||||
Reference in New Issue
Block a user