lock read from bsig.BitDepth, not just write to it

This commit is contained in:
Seebs 2021-02-23 13:47:34 -06:00
parent 8eaa4e592f
commit c1c0e828cd

View file

@ -1596,15 +1596,15 @@ func (f *Field) importValue(qcx *Qcx, columnIDs []uint64, values []int64, option
requiredDepth = v
}
// Increase bit depth if required.
f.mu.Lock()
bitDepth := bsig.BitDepth
if requiredDepth > bitDepth {
f.mu.Lock()
bsig.BitDepth = requiredDepth
f.options.BitDepth = requiredDepth
f.mu.Unlock()
} else {
requiredDepth = bitDepth
}
f.mu.Unlock()
// Import into each fragment.
for key, data := range dataByFragment {