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

Generalize the constant propagation optimization so that it applies on every

WHERE close, not just those that contain a subquery.  This then demonstrates
that the current implementation is inadequate since it does not take into
account collating sequences.

FossilOrigin-Name: 57eb2abd5b270d65be5e0f138f0d46899fa6091df3ba20b0ea7ef04244a15d48
This commit is contained in:
drh
2018-07-26 23:47:11 +00:00
parent 660ee55663
commit 24e1116e0f
5 changed files with 40 additions and 27 deletions

View File

@@ -4935,7 +4935,7 @@ int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTab){
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
}else if( pA->op==TK_COLLATE ){
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
}else if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
}else if( pA->op!=TK_UPLUS && strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
return 2;
}
}