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.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user