Skip to content

Commit a248ecd

Browse files
asg017claude
andcommitted
Fix DiskANN command dispatch when IVF is disabled
The command insert handler (used for runtime config like search_list_size_search) was gated behind SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE, which defaults to 0. DiskANN commands were unreachable unless IVF was also compiled in. Widen the guard to also activate when SQLITE_VEC_ENABLE_DISKANN is set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1e3bb3e commit a248ecd

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

sqlite-vec.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10143,14 +10143,17 @@ static int vec0Update(sqlite3_vtab *pVTab, int argc, sqlite3_value **argv,
1014310143
}
1014410144
// INSERT operation
1014510145
else if (argc > 1 && sqlite3_value_type(argv[0]) == SQLITE_NULL) {
10146-
#if SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE
10147-
// Check for IVF command inserts: INSERT INTO t(rowid) VALUES ('compute-centroids')
10146+
#if SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE || SQLITE_VEC_ENABLE_DISKANN
10147+
// Check for command inserts: INSERT INTO t(rowid) VALUES ('command-string')
1014810148
// The id column holds the command string.
1014910149
sqlite3_value *idVal = argv[2 + VEC0_COLUMN_ID];
1015010150
if (sqlite3_value_type(idVal) == SQLITE_TEXT) {
1015110151
const char *cmd = (const char *)sqlite3_value_text(idVal);
1015210152
vec0_vtab *p = (vec0_vtab *)pVTab;
10153-
int cmdRc = ivf_handle_command(p, cmd, argc, argv);
10153+
int cmdRc = SQLITE_EMPTY;
10154+
#if SQLITE_VEC_EXPERIMENTAL_IVF_ENABLE
10155+
cmdRc = ivf_handle_command(p, cmd, argc, argv);
10156+
#endif
1015410157
#if SQLITE_VEC_ENABLE_DISKANN
1015510158
if (cmdRc == SQLITE_EMPTY)
1015610159
cmdRc = diskann_handle_command(p, cmd);

0 commit comments

Comments
 (0)