@@ -137030,10 +137030,11 @@ SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
137030137030 * As vector index creates empty B-tree index - it's safe to issue
137031137031 * OP_OpenRead command for it
137032137032 *
137033- * TODO: with current implementation, integrity_check will output error
137034- * for vector index as rows will be missed in it
137035- * It's better to remove this error in future - but for now it's unclear
137036- * how to do that with minimal code changes
137033+ * In order to not produce integrity check errors we skip vector indices
137034+ * from integrity checks in pragma.c implementation
137035+ *
137036+ * Note, that it's dangerous to skip some indices in this code as sqlite3 rely
137037+ * on the fact that cursors will be opened for every index in order
137037137038 */
137038137039#ifndef SQLITE_OMIT_VECTOR
137039137040 if( IsVectorIndex(pIdx) && op == OP_OpenWrite ){
@@ -142035,6 +142036,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
142035142036 int kk;
142036142037 int ckUniq = sqlite3VdbeMakeLabel(pParse);
142037142038 if( pPk==pIdx ) continue;
142039+ if( IsVectorIndex(pIdx) ) continue;
142038142040 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
142039142041 pPrior, r1);
142040142042 pPrior = pIdx;
@@ -142119,6 +142121,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
142119142121 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
142120142122 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
142121142123 if( pPk==pIdx ) continue;
142124+ if( IsVectorIndex(pIdx) ) continue;
142122142125 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
142123142126 addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+j, 0, 3); VdbeCoverage(v);
142124142127 sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
0 commit comments