2
0

Merge branch 'master' into v5-dev

Rewrite fix for https://github.com/jackc/pgx/issues/1196 for pgx v5.
This commit is contained in:
Jack Christensen
2022-04-28 08:06:34 -05:00
2 changed files with 16 additions and 2 deletions
+2 -2
View File
@@ -740,7 +740,7 @@ optionLoop:
rows := c.getRows(ctx, sql, args)
var err error
sd := c.preparedStatements[sql]
sd, explicitPreparedStatement := c.preparedStatements[sql]
if sd != nil || mode == QueryExecModeCacheStatement || mode == QueryExecModeCacheDescribe || mode == QueryExecModeDescribeExec {
if sd == nil {
switch mode {
@@ -806,7 +806,7 @@ optionLoop:
resultFormats = c.eqb.resultFormats
}
if mode == QueryExecModeCacheDescribe {
if !explicitPreparedStatement && mode == QueryExecModeCacheDescribe {
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)