mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 17:12:25 -05:00
[chore]: Bump github.com/jackc/pgx/v5 from 5.5.5 to 5.6.0 (#2929)
This commit is contained in:
parent
3d3e99ae52
commit
0a18c0d802
36 changed files with 969 additions and 561 deletions
7
vendor/github.com/jackc/pgx/v5/large_objects.go
generated
vendored
7
vendor/github.com/jackc/pgx/v5/large_objects.go
generated
vendored
|
|
@ -4,6 +4,8 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
// The PostgreSQL wire protocol has a limit of 1 GB - 1 per message. See definition of
|
||||
|
|
@ -115,9 +117,10 @@ func (o *LargeObject) Read(p []byte) (int, error) {
|
|||
expected = maxLargeObjectMessageLength
|
||||
}
|
||||
|
||||
var res []byte
|
||||
res := pgtype.PreallocBytes(p[nTotal:])
|
||||
err := o.tx.QueryRow(o.ctx, "select loread($1, $2)", o.fd, expected).Scan(&res)
|
||||
copy(p[nTotal:], res)
|
||||
// We compute expected so that it always fits into p, so it should never happen
|
||||
// that PreallocBytes's ScanBytes had to allocate a new slice.
|
||||
nTotal += len(res)
|
||||
if err != nil {
|
||||
return nTotal, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue