Skip to content

Commit 2e4398b

Browse files
authored
Correct handling of SQLITE_TEXT during CDC
1 parent 8bf7a8a commit 2e4398b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sqlite3_opt_preupdate_hook.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ func (d *SQLitePreUpdateData) row(dest []any, new bool) error {
7878
blobptr := C.sqlite3_value_blob(val)
7979
src = C.GoBytes(blobptr, len)
8080
case C.SQLITE_TEXT:
81-
len := C.sqlite3_value_bytes(val)
8281
cstrptr := unsafe.Pointer(C.sqlite3_value_text(val))
83-
src = C.GoBytes(cstrptr, len)
82+
src = C.GoString((*C.char)(cstrptr))
8483
case C.SQLITE_NULL:
8584
src = nil
8685
}

0 commit comments

Comments
 (0)