Skip to content

Commit f22c7fd

Browse files
committed
Fixed a possible issue during quantization
1 parent afe0757 commit f22c7fd

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/sqlite-vector.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ static int vector_rebuild_quantization (sqlite3_context *context, const char *ta
12471247
rc = SQLITE_ERROR;
12481248
goto vector_rebuild_quantization_cleanup;
12491249
}
1250+
12501251
if (val < min_val) min_val = val;
12511252
if (val > max_val) max_val = val;
12521253
if (val < 0.0) contains_negative = true;
@@ -1425,7 +1426,7 @@ static int vector_quantize (sqlite3_context *context, const char *table_name, co
14251426
rc = sqlite3_exec(db, sql, NULL, NULL, NULL);
14261427
if (rc != SQLITE_OK) goto quantize_cleanup;
14271428

1428-
vector_options options = vector_options_create();
1429+
vector_options options = t_ctx->options; // t_ctx guarantees to exist
14291430
bool res = parse_keyvalue_string(context, arg_options, vector_keyvalue_callback, &options);
14301431
if (res == false) return SQLITE_ERROR;
14311432

@@ -2273,15 +2274,6 @@ static int vStreamScanBestIndex (sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo
22732274
return SQLITE_OK;
22742275
}
22752276

2276-
static int vStreamScanCursorOpen (sqlite3_vtab *pVtab, sqlite3_vtab_cursor **ppCursor) {
2277-
int rc = vFullScanCursorOpen(pVtab, ppCursor);
2278-
if (rc != SQLITE_OK) return rc;
2279-
2280-
vFullScanCursor *c = (vFullScanCursor *)*ppCursor;
2281-
c->is_streaming = true;
2282-
return SQLITE_OK;
2283-
}
2284-
22852277
static int vStreamScanCursorRun (sqlite3 *db, vFullScanCursor *c, const void *v1, int v1size) {
22862278
// duplicate input vector (to be later used by the Next callback)
22872279
void *v = sqlite_memdup(v1, v1size);

src/sqlite-vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27-
#define SQLITE_VECTOR_VERSION "0.9.22"
27+
#define SQLITE_VECTOR_VERSION "0.9.23"
2828

2929
SQLITE_VECTOR_API int sqlite3_vector_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
3030

0 commit comments

Comments
 (0)