diff options
Diffstat (limited to 'src/delete.c')
-rw-r--r-- | src/delete.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c index 860a2739a..117347ef9 100644 --- a/src/delete.c +++ b/src/delete.c @@ -209,7 +209,11 @@ Expr *sqlite3LimitWhere( pSrc->a[0].pTab = 0; pSelectSrc = sqlite3SrcListDup(pParse->db, pSrc, 0); pSrc->a[0].pTab = pTab; - pSrc->a[0].pIBIndex = 0; + if( pSrc->a[0].fg.isIndexedBy ){ + pSrc->a[0].u2.pIBIndex = 0; + }else if( pSrc->a[0].fg.isCte ){ + pSrc->a[0].u2.pCteUse->nUse++; + } /* generate the SELECT expression tree. */ pSelect = sqlite3SelectNew(pParse, pEList, pSelectSrc, pWhere, 0 ,0, |