2
0

Fix explicitly prepared statements with describe statement cache mode

fixes https://github.com/jackc/pgx/issues/1196
This commit is contained in:
Jack Christensen
2022-04-28 07:58:24 -05:00
parent c6335a30d0
commit 7ceeea6fe6
2 changed files with 45 additions and 1 deletions
+1 -1
View File
@@ -645,7 +645,7 @@ optionLoop:
resultFormats = c.eqb.resultFormats
}
if c.stmtcache != nil && c.stmtcache.Mode() == stmtcache.ModeDescribe {
if c.stmtcache != nil && c.stmtcache.Mode() == stmtcache.ModeDescribe && !ok {
rows.resultReader = c.pgConn.ExecParams(ctx, sql, c.eqb.paramValues, sd.ParamOIDs, c.eqb.paramFormats, resultFormats)
} else {
rows.resultReader = c.pgConn.ExecPrepared(ctx, sd.Name, c.eqb.paramValues, c.eqb.paramFormats, resultFormats)