mirror of https://github.com/jackc/pgx.git
Do not recursively call public PlanScan that caches
Otherwise, wrapper types get cached. Wrapper types are expected to fail most of the time. These failures should not be cached. In addition, wrappers wrap multiple different types so it doesn't make sense to cache results of a wrapper.query-exec-mode
parent
a8f6674a07
commit
45a8b00271
|
@ -1068,7 +1068,7 @@ func (m *Map) planScan(oid uint32, formatCode int16, target interface{}) ScanPla
|
|||
|
||||
for _, f := range m.TryWrapScanPlanFuncs {
|
||||
if wrapperPlan, nextDst, ok := f(target); ok {
|
||||
if nextPlan := m.PlanScan(oid, formatCode, nextDst); nextPlan != nil {
|
||||
if nextPlan := m.planScan(oid, formatCode, nextDst); nextPlan != nil {
|
||||
if _, failed := nextPlan.(*scanPlanFail); !failed {
|
||||
wrapperPlan.SetNext(nextPlan)
|
||||
return wrapperPlan
|
||||
|
|
Loading…
Reference in New Issue