@@ -137025,10 +137025,11 @@ SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
137025137025 * As vector index creates empty B-tree index - it's safe to issue
137026137026 * OP_OpenRead command for it
137027137027 *
137028- * TODO: with current implementation, integrity_check will output error
137029- * for vector index as rows will be missed in it
137030- * It's better to remove this error in future - but for now it's unclear
137031- * how to do that with minimal code changes
137028+ * In order to not produce integrity check errors we skip vector indices
137029+ * from integrity checks in pragma.c implementation
137030+ *
137031+ * Note, that it's dangerous to skip some indices in this code as sqlite3 rely
137032+ * on the fact that cursors will be opened for every index in order
137032137033 */
137033137034#ifndef SQLITE_OMIT_VECTOR
137034137035 if( IsVectorIndex(pIdx) && op == OP_OpenWrite ){
@@ -142030,6 +142031,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
142030142031 int kk;
142031142032 int ckUniq = sqlite3VdbeMakeLabel(pParse);
142032142033 if( pPk==pIdx ) continue;
142034+ if( IsVectorIndex(pIdx) ) continue;
142033142035 r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
142034142036 pPrior, r1);
142035142037 pPrior = pIdx;
@@ -142114,6 +142116,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
142114142116 sqlite3VdbeLoadString(v, 2, "wrong # of entries in index ");
142115142117 for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
142116142118 if( pPk==pIdx ) continue;
142119+ if( IsVectorIndex(pIdx) ) continue;
142117142120 sqlite3VdbeAddOp2(v, OP_Count, iIdxCur+j, 3);
142118142121 addr = sqlite3VdbeAddOp3(v, OP_Eq, 8+j, 0, 3); VdbeCoverage(v);
142119142122 sqlite3VdbeChangeP5(v, SQLITE_NOTNULL);
0 commit comments