mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
upstep bun to v1.0.14 (#291)
This commit is contained in:
19
vendor/github.com/uptrace/bun/dialect/pgdialect/array_parser.go
generated
vendored
19
vendor/github.com/uptrace/bun/dialect/pgdialect/array_parser.go
generated
vendored
@ -2,6 +2,7 @@ package pgdialect
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
@ -109,11 +110,29 @@ func (p *arrayParser) readSubstring() ([]byte, error) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
if c == '\'' && next == '\'' {
|
||||
p.buf = append(p.buf, next)
|
||||
c, err = p.readByte()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
p.buf = append(p.buf, c)
|
||||
c = next
|
||||
}
|
||||
|
||||
if bytes.HasPrefix(p.buf, []byte("\\x")) && len(p.buf)%2 == 0 {
|
||||
data := p.buf[2:]
|
||||
buf := make([]byte, hex.DecodedLen(len(data)))
|
||||
n, err := hex.Decode(buf, data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return buf[:n], nil
|
||||
}
|
||||
|
||||
return p.buf, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user