1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Allow LIKE operators that appear in a WHERE clause to be included in the cursor-hint for a cursor on the rhs of a LEFT JOIN.

FossilOrigin-Name: 7455d932f5079ffe40462a8c119fc22b8a9bcbcc
This commit is contained in:
dan
2016-06-20 17:22:06 +00:00
parent e6912fd819
commit 2b693d63e4
4 changed files with 28 additions and 9 deletions

View File

@ -642,12 +642,19 @@ static int codeCursorHintCheckExpr(Walker *pWalker, Expr *pExpr){
** CASE WHEN col THEN 0 ELSE 1 END
*/
static int codeCursorHintIsOrFunction(Walker *pWalker, Expr *pExpr){
if( pExpr->op==TK_IS || pExpr->op==TK_FUNCTION
if( pExpr->op==TK_IS
|| pExpr->op==TK_ISNULL || pExpr->op==TK_ISNOT
|| pExpr->op==TK_NOTNULL || pExpr->op==TK_CASE
){
pWalker->eCode = 1;
}else if( pExpr->op==TK_FUNCTION ){
int d1;
char d2[3];
if( 0==sqlite3IsLikeFunction(pWalker->pParse->db, pExpr, &d1, d2) ){
pWalker->eCode = 1;
}
}
return WRC_Continue;
}