This commit is contained in:
shanyy 2018-04-16 13:49:18 +08:00
parent fc1b13e0d8
commit 9e1c0ee31d
1 changed files with 7 additions and 1 deletions

View File

@ -390,7 +390,13 @@ func (session *Session) cacheFind(t reflect.Type, sqlStr string, rowsSlicePtr in
return err return err
} }
bean := cacher.GetBean(tableName, sid) 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) ides = append(ides, id)
ididxes[sid] = idx ididxes[sid] = idx
} else { } else {