Skip to content

vec0 UPDATE SET rowid reports success but silently leaves the rowid unchanged #332

Open

Description

@JoeyLYZ666

Description

On a vec0 virtual table, UPDATE ... SET rowid = <new> reports rowcount = 1 (one row affected) but silently leaves the rowid unchanged. The caller is told the update succeeded; the table did not change.

Environment

  • sqlite-vec 0.1.9 (pip loadable extension), Python 3.12 sqlite3, Windows x64

Steps to reproduce

db.execute("CREATE VIRTUAL TABLE v USING vec0(a float[2])")
db.execute("INSERT INTO v(rowid, a) VALUES (1, ?)", ...); db.execute("INSERT INTO v(rowid, a) VALUES (2, ?)", ...)
cur = db.execute("UPDATE v SET rowid = 3 WHERE rowid = 2")
print(cur.rowcount)                                   # 1  <- claims success
print(db.execute("SELECT rowid FROM v").fetchall())   # [(1,), (2,)]  <- unchanged

Full script attached (reproduce.py).

Expected behavior

Either the rowid update is applied (rowid 2 becomes 3), or the statement fails with a clear error ("rowid updates are not supported on vec0 tables"). Silently reporting success while doing nothing violates SQLite's statement semantics.

Actual behavior

rowcount=1, no change, no error.

Additional notes

  • UPDATE of the vector column itself works correctly (verified: stored vector, distances and metadata all update consistently) — only the rowid target is affected.
  • Plain-table control: UPDATE t SET rowid_ = 3 WHERE rowid_ = 2 applies normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions