mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/jackc/pgx/v4 from 4.17.2 to 4.18.1 (#1595)
Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.17.2 to 4.18.1. - [Release notes](https://github.com/jackc/pgx/releases) - [Changelog](https://github.com/jackc/pgx/blob/v4.18.1/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v4.17.2...v4.18.1) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
13
vendor/github.com/jackc/pgx/v4/CHANGELOG.md
generated
vendored
13
vendor/github.com/jackc/pgx/v4/CHANGELOG.md
generated
vendored
@@ -1,3 +1,16 @@
|
||||
# 4.18.1 (February 27, 2023)
|
||||
|
||||
* Fix: Support pgx v4 and v5 stdlib in same program (Tomáš Procházka)
|
||||
|
||||
# 4.18.0 (February 11, 2023)
|
||||
|
||||
* Upgrade pgconn to v1.14.0
|
||||
* Upgrade pgproto3 to v2.3.2
|
||||
* Upgrade pgtype to v1.14.0
|
||||
* Fix query sanitizer when query text contains Unicode replacement character
|
||||
* Fix context with value in BeforeConnect (David Harju)
|
||||
* Support pgx v4 and v5 stdlib in same program (Vitalii Solodilov)
|
||||
|
||||
# 4.17.2 (September 3, 2022)
|
||||
|
||||
* Fix panic when logging batch error (Tom Möller)
|
||||
|
2
vendor/github.com/jackc/pgx/v4/README.md
generated
vendored
2
vendor/github.com/jackc/pgx/v4/README.md
generated
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
---
|
||||
|
||||
This is the stable `v4` release. `v5` is now in beta testing with final release expected in September. See https://github.com/jackc/pgx/issues/1273 for more information. Please consider testing `v5`.
|
||||
This is the previous stable `v4` release. `v5` been released.
|
||||
|
||||
---
|
||||
# pgx - PostgreSQL Driver and Toolkit
|
||||
|
10
vendor/github.com/jackc/pgx/v4/conn.go
generated
vendored
10
vendor/github.com/jackc/pgx/v4/conn.go
generated
vendored
@@ -535,9 +535,13 @@ type QueryResultFormats []int16
|
||||
// QueryResultFormatsByOID controls the result format (text=0, binary=1) of a query by the result column OID.
|
||||
type QueryResultFormatsByOID map[uint32]int16
|
||||
|
||||
// Query executes sql with args. It is safe to attempt to read from the returned Rows even if an error is returned. The
|
||||
// error will be the available in rows.Err() after rows are closed. So it is allowed to ignore the error returned from
|
||||
// Query and handle it in Rows.
|
||||
// Query sends a query to the server and returns a Rows to read the results. Only errors encountered sending the query
|
||||
// and initializing Rows will be returned. Err() on the returned Rows must be checked after the Rows is closed to
|
||||
// determine if the query executed successfully.
|
||||
//
|
||||
// The returned Rows must be closed before the connection can be used again. It is safe to attempt to read from the
|
||||
// returned Rows even if an error is returned. The error will be the available in rows.Err() after rows are closed. It
|
||||
// is allowed to ignore the error returned from Query and handle it in Rows.
|
||||
//
|
||||
// Err() on the returned Rows must be checked after the Rows is closed to determine if the query executed successfully
|
||||
// as some errors can only be detected by reading the entire response. e.g. A divide by zero error on the last row.
|
||||
|
66
vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go
generated
vendored
66
vendor/github.com/jackc/pgx/v4/internal/sanitize/sanitize.go
generated
vendored
@@ -18,6 +18,12 @@ type Query struct {
|
||||
Parts []Part
|
||||
}
|
||||
|
||||
// utf.DecodeRune returns the utf8.RuneError for errors. But that is actually rune U+FFFD -- the unicode replacement
|
||||
// character. utf8.RuneError is not an error if it is also width 3.
|
||||
//
|
||||
// https://github.com/jackc/pgx/issues/1380
|
||||
const replacementcharacterwidth = 3
|
||||
|
||||
func (q *Query) Sanitize(args ...interface{}) (string, error) {
|
||||
argUse := make([]bool, len(args))
|
||||
buf := &bytes.Buffer{}
|
||||
@@ -138,11 +144,13 @@ func rawState(l *sqlLexer) stateFn {
|
||||
return multilineCommentState
|
||||
}
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,11 +168,13 @@ func singleQuoteState(l *sqlLexer) stateFn {
|
||||
}
|
||||
l.pos += width
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,11 +192,13 @@ func doubleQuoteState(l *sqlLexer) stateFn {
|
||||
}
|
||||
l.pos += width
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,11 +240,13 @@ func escapeStringState(l *sqlLexer) stateFn {
|
||||
}
|
||||
l.pos += width
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,11 +263,13 @@ func oneLineCommentState(l *sqlLexer) stateFn {
|
||||
case '\n', '\r':
|
||||
return rawState
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,11 +299,13 @@ func multilineCommentState(l *sqlLexer) stateFn {
|
||||
l.nested--
|
||||
|
||||
case utf8.RuneError:
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
if width != replacementcharacterwidth {
|
||||
if l.pos-l.start > 0 {
|
||||
l.parts = append(l.parts, l.src[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
vendor/github.com/jackc/pgx/v4/stdlib/sql.go
generated
vendored
19
vendor/github.com/jackc/pgx/v4/stdlib/sql.go
generated
vendored
@@ -84,7 +84,13 @@ func init() {
|
||||
configs: make(map[string]*pgx.ConnConfig),
|
||||
}
|
||||
fakeTxConns = make(map[*pgx.Conn]*sql.Tx)
|
||||
sql.Register("pgx", pgxDriver)
|
||||
|
||||
// if pgx driver was already registered by different pgx major version then we
|
||||
// skip registration under the default name.
|
||||
if !contains(sql.Drivers(), "pgx") {
|
||||
sql.Register("pgx", pgxDriver)
|
||||
}
|
||||
sql.Register("pgx/v4", pgxDriver)
|
||||
|
||||
databaseSQLResultFormats = pgx.QueryResultFormatsByOID{
|
||||
pgtype.BoolOID: 1,
|
||||
@@ -103,6 +109,17 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO replace by slices.Contains when experimental package will be merged to stdlib
|
||||
// https://pkg.go.dev/golang.org/x/exp/slices#Contains
|
||||
func contains(list []string, y string) bool {
|
||||
for _, x := range list {
|
||||
if x == y {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
fakeTxMutex sync.Mutex
|
||||
fakeTxConns map[*pgx.Conn]*sql.Tx
|
||||
|
Reference in New Issue
Block a user