scorch zap panic if mergeFields() sees unsorted fields
mergeFields depends on the fields from the various segments being sorted for the fieldsSame comparison to work. Of note, the 'fieldi > 1' guard skips the 0th field, which should always be the '_id' field.
This commit is contained in:
parent
85b4a31e2a
commit
2f4d3d8587
|
@ -755,6 +755,10 @@ func mergeFields(segments []*SegmentBase) (bool, []string) {
|
||||||
if len(segment0Fields) != len(fields) || segment0Fields[fieldi] != field {
|
if len(segment0Fields) != len(fields) || segment0Fields[fieldi] != field {
|
||||||
fieldsSame = false
|
fieldsSame = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fieldi > 1 && field <= fields[fieldi-1] {
|
||||||
|
panic(fmt.Sprintf("mergeFields on unsorted fields: %#v", fields))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue