This commit is contained in:
shanyy 2018-04-16 13:49:18 +08:00 committed by Lunny Xiao
parent 9251a5165d
commit f1e89c225d
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 7 additions and 1 deletions

View File

@ -396,7 +396,13 @@ func (session *Session) cacheFind(t reflect.Type, sqlStr string, rowsSlicePtr in
return err
}
bean := cacher.GetBean(tableName, sid)
if bean == nil || reflect.ValueOf(bean).Elem().Type() != t {
// fix issue #894
ckt := t
if ckt.Kind() == reflect.Ptr {
ckt = t.Elem()
}
if bean == nil || reflect.ValueOf(bean).Elem().Type() != ckt {
ides = append(ides, id)
ididxes[sid] = idx
} else {