1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix a failing assert() in the new code on this branch.

FossilOrigin-Name: 74d857d178dfadea7e07ba47439fe11aa9d282b54caf78cd6961e593b37406d0
This commit is contained in:
dan
2018-01-31 14:07:01 +00:00
parent 8433e7166b
commit 4ea48144f9
4 changed files with 20 additions and 14 deletions

View File

@@ -2481,8 +2481,7 @@ static int whereLoopAddBtreeIndex(
if( iCol==XN_ROWID
|| (iCol>=0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1)
){
assert( iCol!=XN_ROWID || pProbe->uniqNotNull );
if( pProbe->uniqNotNull
if( iCol==XN_ROWID || pProbe->uniqNotNull
|| (pProbe->nKeyCol==1 && pProbe->onError && eOp==WO_EQ)
){
pNew->wsFlags |= WHERE_ONEROW;
@@ -2828,7 +2827,6 @@ static int whereLoopAddBtree(
sPk.onError = OE_Replace;
sPk.pTable = pTab;
sPk.szIdxRow = pTab->szTabRow;
sPk.uniqNotNull = 1;
aiRowEstPk[0] = pTab->nRowLogEst;
aiRowEstPk[1] = 0;
pFirst = pSrc->pTab->pIndex;