From f257be992620f2d86130e0f88416452be7cea9a9 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Tue, 19 Sep 2017 21:37:35 -0500 Subject: [PATCH] FieldSum calls fragment.row which needs write lock remove read lock and call fragment.Row --- fragment.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fragment.go b/fragment.go index 35bd4c7be..18e2cf1b5 100644 --- a/fragment.go +++ b/fragment.go @@ -545,11 +545,8 @@ func (f *Fragment) SetFieldValue(columnID uint64, bitDepth uint, value uint64) ( // FieldSum returns the sum of a given field as well as the number of columns involved. // A bitmap can be passed in to optionally filter the computed columns. func (f *Fragment) FieldSum(filter *Bitmap, bitDepth uint) (sum, count uint64, err error) { - f.mu.RLock() - defer f.mu.RUnlock() - // Compute count based on the existance bit. - row := f.row(uint64(bitDepth), true, true) + row := f.Row(uint64(bitDepth)) if filter != nil { row = row.Intersect(filter) } @@ -563,7 +560,7 @@ func (f *Fragment) FieldSum(filter *Bitmap, bitDepth uint) (sum, count uint64, e // 10*(2^0) + 4*(2^1) + 3*(2^2) = 30 // for i := uint(0); i < bitDepth; i++ { - row := f.row(uint64(i), true, true) + row := f.Row(uint64(i)) if filter != nil { row = row.Intersect(filter) }