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

Consider the values bound to SQL variables when determining whether or not a

partial index may be used.

FossilOrigin-Name: 7b59c353b805c64689b4ae9df347705acbb5f116346ad77af8ce087da7893747
This commit is contained in:
dan
2017-06-24 18:10:29 +00:00
parent 7f2d1cd2b0
commit 5aa550cf3b
11 changed files with 183 additions and 43 deletions

View File

@@ -5005,7 +5005,9 @@ static struct SrcList_item *isSelfJoinView(
if( pItem->zName==0 ) continue;
if( sqlite3_stricmp(pItem->zDatabase, pThis->zDatabase)!=0 ) continue;
if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue;
if( sqlite3ExprCompare(pThis->pSelect->pWhere, pItem->pSelect->pWhere, -1) ){
if( sqlite3ExprCompare(0,
pThis->pSelect->pWhere, pItem->pSelect->pWhere, -1)
){
/* The view was modified by some other optimization such as
** pushDownWhereTerms() */
continue;