Merge pull request #1759 from qinyuguang/gdb_cache

fix issue #1755
This commit is contained in:
John Guo 2022-04-18 20:22:38 +08:00 committed by GitHub
commit e4e4534c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,10 +86,14 @@ func (m *Model) getSelectResultFromCache(ctx context.Context, sql string, args .
if cacheItem, ok = v.Val().(*selectCacheItem); ok {
// In-memory cache.
return cacheItem.Result, nil
} else if err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem); err != nil {
} else {
// Other cache, it needs conversion.
err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem)
if err != nil {
return nil, err
}
return cacheItem.Result, nil
}
}
return
}