mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 16:24:37 +03:00
update to latest bstore, with a bugfix for queries with multiple orders that were partially handled by an index
causing returned order to be incorrect. was triggered by new code i'm working on.
This commit is contained in:
9
vendor/github.com/mjl-/bstore/keys.go
generated
vendored
9
vendor/github.com/mjl-/bstore/keys.go
generated
vendored
@ -132,7 +132,8 @@ func parsePK(rv reflect.Value, bk []byte) error {
|
||||
// parseKey parses the PK (last element) of an index key.
|
||||
// If all is set, also gathers the values before and returns them in the second
|
||||
// parameter.
|
||||
func (idx *index) parseKey(buf []byte, all bool) ([]byte, [][]byte, error) {
|
||||
// If witnull is set, string values will get their ending \0 included.
|
||||
func (idx *index) parseKey(buf []byte, all bool, withnull bool) ([]byte, [][]byte, error) {
|
||||
var err error
|
||||
var keys [][]byte
|
||||
take := func(n int) {
|
||||
@ -160,7 +161,11 @@ fields:
|
||||
for i, b := range buf {
|
||||
if b == 0 {
|
||||
if all {
|
||||
keys = append(keys, buf[:i])
|
||||
o := i
|
||||
if withnull {
|
||||
o++
|
||||
}
|
||||
keys = append(keys, buf[:o])
|
||||
}
|
||||
buf = buf[i+1:]
|
||||
continue fields
|
||||
|
Reference in New Issue
Block a user