Current code fails to delete row from vector index if it had NULL vector value before:
$> CREATE TABLE t_null( v FLOAT32(3));
$> CREATE INDEX t_null_idx ON t_null( libsql_vector_idx(v) );
$> INSERT INTO t_null VALUES(NULL);
$> DELETE FROM t_null WHERE rowid = 1;
Runtime error: vector index(delete): failed to create blob for node row (233)
This is because vectorIndexDelete expects to always find corresponding row in the shadow table but since we are ignoring NULL values during inserts this invariant violated in such scenario.
This PR fixes this issue by simply ignoring such cases and exit silently if no row in shadow table were found during vectorIndexDelete operation
Context
Current code fails to delete row from vector index if it had
NULL
vector value before:This is because
vectorIndexDelete
expects to always find corresponding row in the shadow table but since we are ignoringNULL
values during inserts this invariant violated in such scenario.This PR fixes this issue by simply ignoring such cases and exit silently if no row in shadow table were found during
vectorIndexDelete
operation