store/cockroach: fix dropped errors (#1796)
Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
parent
51caf2a24e
commit
2b033b6495
@ -332,10 +332,11 @@ func (s *sqlStore) read(key string, options store.ReadOptions) ([]*store.Record,
|
||||
}
|
||||
|
||||
var rows *sql.Rows
|
||||
var st *sql.Stmt
|
||||
var err error
|
||||
|
||||
if options.Limit != 0 {
|
||||
st, err := s.prepare(options.Database, options.Table, "readOffset")
|
||||
st, err = s.prepare(options.Database, options.Table, "readOffset")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -343,7 +344,7 @@ func (s *sqlStore) read(key string, options store.ReadOptions) ([]*store.Record,
|
||||
|
||||
rows, err = st.Query(pattern, options.Limit, options.Offset)
|
||||
} else {
|
||||
st, err := s.prepare(options.Database, options.Table, "readMany")
|
||||
st, err = s.prepare(options.Database, options.Table, "readMany")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user