diff options
author | 2024-12-12 19:44:53 +0000 | |
---|---|---|
committer | 2024-12-12 19:44:53 +0000 | |
commit | fb12bbb10b228fddf40ebd0e463d5afcd9299ebb (patch) | |
tree | c9239fe362ea38e71ab4363649ceff605cb4ab89 /vendor/github.com/ncruces/go-sqlite3/stmt.go | |
parent | Bump nanoid from 3.3.7 to 5.0.9 in /web/source (#3615) (diff) | |
download | gotosocial-fb12bbb10b228fddf40ebd0e463d5afcd9299ebb.tar.xz |
bump ncruces/go-sqlite3 to v0.21.0 (#3621)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/stmt.go')
-rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/stmt.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/stmt.go b/vendor/github.com/ncruces/go-sqlite3/stmt.go index 139dd3525..f1648f076 100644 --- a/vendor/github.com/ncruces/go-sqlite3/stmt.go +++ b/vendor/github.com/ncruces/go-sqlite3/stmt.go @@ -582,7 +582,9 @@ func (s *Stmt) ColumnRawBlob(col int) []byte { func (s *Stmt) columnRawBytes(col int, ptr uint32) []byte { if ptr == 0 { r := s.c.call("sqlite3_errcode", uint64(s.c.handle)) - s.err = s.c.error(r) + if r != _ROW && r != _DONE { + s.err = s.c.error(r) + } return nil } @@ -637,7 +639,7 @@ func (s *Stmt) ColumnValue(col int) Value { // [TEXT] as string, and [BLOB] as []byte. // Any []byte are owned by SQLite and may be invalidated by // subsequent calls to [Stmt] methods. -func (s *Stmt) Columns(dest []any) error { +func (s *Stmt) Columns(dest ...any) error { defer s.c.arena.mark()() count := uint64(len(dest)) typePtr := s.c.arena.new(count) @@ -666,6 +668,10 @@ func (s *Stmt) Columns(dest []any) error { dest[i] = nil default: ptr := util.ReadUint32(s.c.mod, dataPtr+0) + if ptr == 0 { + dest[i] = []byte{} + continue + } len := util.ReadUint32(s.c.mod, dataPtr+4) buf := util.View(s.c.mod, ptr, uint64(len)) if types[i] == byte(TEXT) { |