mirror of https://github.com/jackc/pgx.git
Handle stmtCache.Get error previously thought impossible
The statement cache is already prefilled, but it is possible for the ctx to be canceled between when the statement is prepared and when the statement is retrieved for use. refs #1156pull/1160/head
parent
3650fc9f68
commit
1e565b0d44
3
conn.go
3
conn.go
|
@ -773,8 +773,7 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) BatchResults {
|
|||
var err error
|
||||
sd, err = stmtCache.Get(ctx, bi.query)
|
||||
if err != nil {
|
||||
// the stmtCache was prefilled from distinctUnpreparedQueries above so we are guaranteed no errors
|
||||
panic("BUG: unexpected error from stmtCache")
|
||||
return &batchResults{ctx: ctx, conn: c, err: err}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue