diff options
| author | 2025-06-10 13:19:18 +0200 | |
|---|---|---|
| committer | 2025-06-10 13:19:18 +0200 | |
| commit | 4ad17788cdaaee71f6ea41a43eaaa2af50853ac9 (patch) | |
| tree | e74237fb986ef7426ceac631c6f4eea210b84028 /vendor/modernc.org/sqlite/sqlite.go | |
| parent | [bugfix] fix existing statuses with invalid visibility (#4253) (diff) | |
| download | gotosocial-4ad17788cdaaee71f6ea41a43eaaa2af50853ac9.tar.xz | |
[chore] update to modernc.org/sqlite v1.38.0 with our concurrency workaround (#4256)
see: https://gitlab.com/cznic/sqlite/-/tags/v1.38.0
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4256
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/modernc.org/sqlite/sqlite.go')
| -rw-r--r-- | vendor/modernc.org/sqlite/sqlite.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go index 728e1870e..39675a68b 100644 --- a/vendor/modernc.org/sqlite/sqlite.go +++ b/vendor/modernc.org/sqlite/sqlite.go @@ -603,6 +603,10 @@ func (s *stmt) query(ctx context.Context, args []driver.NamedValue) (r driver.Ro var allocs []uintptr defer func() { + if r == nil && err == nil { + r, err = newRows(s.c, pstmt, allocs, true) + } + if pstmt != 0 { // ensure stmt finalized. e := s.c.finalize(pstmt) @@ -613,10 +617,6 @@ func (s *stmt) query(ctx context.Context, args []driver.NamedValue) (r driver.Ro err = e } } - - if r == nil && err == nil { - r, err = newRows(s.c, pstmt, allocs, true) - } }() for psql := s.psql; *(*byte)(unsafe.Pointer(psql)) != 0; { @@ -2154,7 +2154,9 @@ func functionArgs(tls *libc.TLS, argc int32, argv uintptr) []driver.Value { size := sqlite3.Xsqlite3_value_bytes(tls, valPtr) blobPtr := sqlite3.Xsqlite3_value_blob(tls, valPtr) v := make([]byte, size) - copy(v, (*libc.RawMem)(unsafe.Pointer(blobPtr))[:size:size]) + if size != 0 { + copy(v, (*libc.RawMem)(unsafe.Pointer(blobPtr))[:size:size]) + } args[i] = v default: panic(fmt.Sprintf("unexpected argument type %q passed by sqlite", valType)) |
