From 1a1bc9e7783ec8ae99770996bd2edbc7c653568c Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 29 Jul 2026 09:01:10 +0900 Subject: [PATCH] Identify updated row by argv 0 in goVUpdate --- sqlite3_opt_vtable.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlite3_opt_vtable.go b/sqlite3_opt_vtable.go index 9e916ea..2c17d30 100644 --- a/sqlite3_opt_vtable.go +++ b/sqlite3_opt_vtable.go @@ -608,7 +608,9 @@ func goVUpdate(pVTab unsafe.Pointer, argc C.int, argv **C.sqlite3_value, pRowid } case argc > 1: - err = v.Update(vals[1], vals[2:]) + // Per the xUpdate contract argv[0] identifies the row being + // updated while argv[1] is its (possibly changed) new rowid. + err = v.Update(vals[0], vals[2:]) } }