mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 15:51:01 +00:00
fix bitdepth race
This commit is contained in:
parent
1f6910b0b8
commit
cda2729935
2 changed files with 20 additions and 25 deletions
24
executor.go
24
executor.go
|
|
@ -3588,13 +3588,11 @@ func (e *executor) collectCallIndexNameMap(ctx context.Context, defaultIndexName
|
|||
m[callIndex] = struct{}{}
|
||||
|
||||
if c.Name == "GroupBy" {
|
||||
if filter, ok, err := c.CallArg("filter"); ok {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "getting filter call")
|
||||
}
|
||||
err := e.collectCallIndexNameMap(ctx, defaultIndexName, filter, m)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "collecting filter call index name")
|
||||
for _, arg := range c.Args {
|
||||
if arg, ok := arg.(*pql.Call); ok {
|
||||
if err := e.collectCallIndexNameMap(ctx, defaultIndexName, arg, m); err != nil {
|
||||
return errors.Wrap(err, "collecting group by call index name")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3617,13 +3615,11 @@ func (e *executor) collectCallIndexKeys(index string, idx *Index, isDefaultIndex
|
|||
}
|
||||
|
||||
if callIndex := c.CallIndex(); callIndex == index || (callIndex == "" && isDefaultIndex) {
|
||||
if filter, ok, err := c.CallArg("filter"); ok {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "getting filter call")
|
||||
}
|
||||
err = e.collectCallIndexKeys(index, idx, isDefaultIndex, filter, keySet)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "translating filter call")
|
||||
for _, arg := range c.Args {
|
||||
if arg, ok := arg.(*pql.Call); ok {
|
||||
if err := e.collectCallIndexKeys(index, idx, isDefaultIndex, arg, keySet); err != nil {
|
||||
return errors.Wrap(err, "translating group by arg call")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
21
field.go
21
field.go
|
|
@ -1490,21 +1490,20 @@ func (f *Field) importValue(columnIDs []uint64, values []int64, options *ImportO
|
|||
requiredDepth = v
|
||||
}
|
||||
// Increase bit depth if required.
|
||||
f.mu.RLock()
|
||||
bitDepth := bsig.BitDepth
|
||||
f.mu.RUnlock()
|
||||
if requiredDepth > bitDepth {
|
||||
if err := func() error {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
if err := func() error {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
bitDepth := bsig.BitDepth
|
||||
if requiredDepth > bitDepth {
|
||||
bsig.BitDepth = requiredDepth
|
||||
f.options.BitDepth = requiredDepth
|
||||
return f.saveMeta()
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "increasing bsi bit depth")
|
||||
} else {
|
||||
requiredDepth = bitDepth
|
||||
}
|
||||
} else {
|
||||
requiredDepth = bitDepth
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return errors.Wrap(err, "increasing bsi bit depth")
|
||||
}
|
||||
|
||||
// Import into each fragment.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue