Fix to the previous checkin: The colUsed parameter should have high-order bit
set if any of the 64-th or greater columns of the virtual table is used. The lower 63 bits of colUsed always show the usage of the first 63 columns of the virtual table. FossilOrigin-Name: 90ac8457750ace1d76d7bc957af7877e86e6301bb07361e19beaf5c7b3b6085a
This commit is contained in:
+4
-1
@@ -1506,9 +1506,12 @@ static sqlite3_index_info *allocateIndexInfo(
|
||||
/* Ensure that all bits associated with PK columns are set. This is to
|
||||
** ensure they are available for cases like RIGHT joins or OR loops. */
|
||||
Index *pPk = sqlite3PrimaryKeyIndex((Table*)pTab);
|
||||
assert( pPk!=0 );
|
||||
for(i=0; i<pPk->nKeyCol; i++){
|
||||
int iCol = pPk->aiColumn[i];
|
||||
pIdxInfo->colUsed |= (iCol>=BMS ? ALLBITS : MASKBIT(iCol));
|
||||
assert( iCol>=0 );
|
||||
if( iCol>=BMS-1 ) iCol = BMS-1;
|
||||
pIdxInfo->colUsed |= MASKBIT(iCol);
|
||||
}
|
||||
}
|
||||
pHidden->pWC = pWC;
|
||||
|
||||
Reference in New Issue
Block a user