set transactions to writable: false for Max/Min/Value calls. these were mistakenly set to true during cleanup

(cherry picked from commit 53a8f58e91)
This commit is contained in:
Matthew Jaffee 2022-12-09 11:59:40 -06:00 committed by Joe Friedrich
parent 24372a9405
commit da85614c24
2 changed files with 3 additions and 3 deletions

View file

@ -1502,7 +1502,7 @@ func (f *Field) ClearValue(qcx *Qcx, columnID uint64) (changed bool, err error)
}
func (f *Field) MaxForShard(qcx *Qcx, shard uint64, filter *Row) (ValCount, error) {
tx, finisher, err := qcx.GetTx(Txo{Write: true, Index: f.idx, Shard: shard})
tx, finisher, err := qcx.GetTx(Txo{Write: false, Index: f.idx, Shard: shard})
defer finisher(&err)
bsig := f.bsiGroup(f.name)
if bsig == nil {
@ -1532,7 +1532,7 @@ func (f *Field) MaxForShard(qcx *Qcx, shard uint64, filter *Row) (ValCount, erro
// (this field must be an Int or Decimal field). It also returns the
// number of times the minimum value appears.
func (f *Field) MinForShard(qcx *Qcx, shard uint64, filter *Row) (ValCount, error) {
tx, finisher, err := qcx.GetTx(Txo{Write: true, Index: f.idx, Shard: shard})
tx, finisher, err := qcx.GetTx(Txo{Write: false, Index: f.idx, Shard: shard})
defer finisher(&err)
bsig := f.bsiGroup(f.name)
if bsig == nil {

View file

@ -533,7 +533,7 @@ func (v *view) clearBit(qcx *Qcx, rowID, columnID uint64) (changed bool, err err
// value uses a column of bits to read a multi-bit value.
func (v *view) value(qcx *Qcx, columnID uint64, bitDepth uint64) (value int64, exists bool, err error) {
shard := columnID / ShardWidth
tx, finisher, err := qcx.GetTx(Txo{Write: true, Index: v.idx, Shard: shard})
tx, finisher, err := qcx.GetTx(Txo{Write: false, Index: v.idx, Shard: shard})
defer finisher(&err)
frag, err := v.CreateFragmentIfNotExists(shard)
if err != nil {