upstep bun to v1.0.14 (#291)

This commit is contained in:
tobi
2021-10-24 13:14:37 +02:00
committed by GitHub
parent 84a8a07f38
commit 8b7c3507fe
100 changed files with 5071 additions and 3836 deletions

View File

@ -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
}