4949** VectorIdxParams utilities
5050****************************************************************************/
5151
52- // VACUUM creates tables and indices first and only then populate data
53- // we need to ignore inserts from 'INSERT INTO vacuum.t SELECT * FROM t' statements because
54- // all shadow tables will be populated by VACUUM process during regular process of table copy
55- #define IsVacuum (db ) ((db->mDbFlags&DBFLAG_Vacuum)!=0)
56-
5752void vectorIdxParamsInit (VectorIdxParams * pParams , u8 * pBinBuf , int nBinSize ) {
5853 assert ( nBinSize <= VECTOR_INDEX_PARAMS_BUF_SIZE );
5954
@@ -772,10 +767,6 @@ int vectorIndexDrop(sqlite3 *db, const char *zDbSName, const char *zIdxName) {
772767 // this is done to prevent unrecoverable situations where index were dropped but index parameters deletion failed and second attempt will fail on first step
773768 int rcIdx , rcParams ;
774769
775- if ( IsVacuum (db ) ){
776- return SQLITE_OK ;
777- }
778-
779770 assert ( zDbSName != NULL );
780771
781772 rcIdx = diskAnnDropIndex (db , zDbSName , zIdxName );
@@ -786,10 +777,6 @@ int vectorIndexDrop(sqlite3 *db, const char *zDbSName, const char *zIdxName) {
786777int vectorIndexClear (sqlite3 * db , const char * zDbSName , const char * zIdxName ) {
787778 assert ( zDbSName != NULL );
788779
789- if ( IsVacuum (db ) ){
790- return SQLITE_OK ;
791- }
792-
793780 return diskAnnClearIndex (db , zDbSName , zIdxName );
794781}
795782
@@ -799,7 +786,7 @@ int vectorIndexClear(sqlite3 *db, const char *zDbSName, const char *zIdxName) {
799786 * this made intentionally in order to natively support upload of SQLite dumps
800787 *
801788 * dump populates tables first and create indices after
802- * so we must omit them because shadow tables already filled
789+ * so we must omit index refill setp because shadow tables already filled
803790 *
804791 * 1. in case of any error :-1 returned (and pParse errMsg is populated with some error message)
805792 * 2. if vector index must not be created : 0 returned
@@ -817,10 +804,6 @@ int vectorIndexCreate(Parse *pParse, const Index *pIdx, const char *zDbSName, co
817804 int hasLibsqlVectorIdxFn = 0 , hasCollation = 0 ;
818805 const char * pzErrMsg ;
819806
820- if ( IsVacuum (pParse -> db ) ){
821- return CREATE_IGNORE ;
822- }
823-
824807 assert ( zDbSName != NULL );
825808
826809 sqlite3 * db = pParse -> db ;
@@ -970,7 +953,6 @@ int vectorIndexSearch(
970953 VectorIdxParams idxParams ;
971954 vectorIdxParamsInit (& idxParams , NULL , 0 );
972955
973- assert ( !IsVacuum (db ) );
974956 assert ( zDbSName != NULL );
975957
976958 if ( argc != 3 ){
@@ -1055,10 +1037,6 @@ int vectorIndexInsert(
10551037 int rc ;
10561038 VectorInRow vectorInRow ;
10571039
1058- if ( IsVacuum (pCur -> db ) ){
1059- return SQLITE_OK ;
1060- }
1061-
10621040 rc = vectorInRowAlloc (pCur -> db , pRecord , & vectorInRow , pzErrMsg );
10631041 if ( rc != SQLITE_OK ){
10641042 return rc ;
@@ -1078,10 +1056,6 @@ int vectorIndexDelete(
10781056){
10791057 VectorInRow payload ;
10801058
1081- if ( IsVacuum (pCur -> db ) ){
1082- return SQLITE_OK ;
1083- }
1084-
10851059 payload .pVector = NULL ;
10861060 payload .nKeys = r -> nField - 1 ;
10871061 payload .pKeyValues = r -> aMem + 1 ;
0 commit comments