mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 18:58:58 -06:00
Reland advance to fix (#3555)
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
const NomsVersion = "7.11"
|
||||
const NomsVersion = "7.12"
|
||||
const NOMS_VERSION_NEXT_ENV_NAME = "NOMS_VERSION_NEXT"
|
||||
const NOMS_VERSION_NEXT_ENV_VALUE = "1"
|
||||
|
||||
|
||||
@@ -308,8 +308,12 @@ func makeMapLeafChunkFn(vr ValueReader) makeChunkFn {
|
||||
d.PanicIfFalse(level == 0)
|
||||
mapData := make([]mapEntry, len(items), len(items))
|
||||
|
||||
var lastKey Value
|
||||
for i, v := range items {
|
||||
mapData[i] = v.(mapEntry)
|
||||
entry := v.(mapEntry)
|
||||
d.PanicIfFalse(lastKey == nil || lastKey.Less(entry.key))
|
||||
lastKey = entry.key
|
||||
mapData[i] = entry
|
||||
}
|
||||
|
||||
m := newMap(newMapLeafSequence(vr, mapData...))
|
||||
|
||||
@@ -95,8 +95,11 @@ func newOrderedMetaSequenceChunkFn(kind NomsKind, vr ValueReader) makeChunkFn {
|
||||
tuples := make([]metaTuple, len(items))
|
||||
numLeaves := uint64(0)
|
||||
|
||||
var lastKey orderedKey
|
||||
for i, v := range items {
|
||||
mt := v.(metaTuple)
|
||||
d.PanicIfFalse(lastKey == emptyKey || lastKey.Less(mt.key))
|
||||
lastKey = mt.key
|
||||
tuples[i] = mt // chunk is written when the root sequence is written
|
||||
numLeaves += mt.numLeaves
|
||||
}
|
||||
|
||||
@@ -107,6 +107,13 @@ func (sc *sequenceChunker) advanceTo(next *sequenceCursor) {
|
||||
for sc.cur.compare(next) < 0 {
|
||||
if sc.Append(sc.cur.current()) && sc.cur.atLastItem() {
|
||||
if sc.cur.parent != nil {
|
||||
|
||||
if sc.cur.parent.compare(next.parent) < 0 {
|
||||
// Case (4): We stopped consuming items on this level before entering
|
||||
// the sequence referenced by |next|
|
||||
reachedNext = false
|
||||
}
|
||||
|
||||
// Note: Logically, what is happening here is that we are consuming the
|
||||
// item at the current level. Logically, we'd call sc.cur.advance(),
|
||||
// but that would force loading of the next sequence, which we don't
|
||||
@@ -119,7 +126,6 @@ func (sc *sequenceChunker) advanceTo(next *sequenceCursor) {
|
||||
sc.cur.seq = nil
|
||||
}
|
||||
|
||||
reachedNext = false // Case (4)
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@@ -275,8 +275,12 @@ func makeSetLeafChunkFn(vr ValueReader) makeChunkFn {
|
||||
d.PanicIfFalse(level == 0)
|
||||
setData := make([]Value, len(items), len(items))
|
||||
|
||||
for i, v := range items {
|
||||
setData[i] = v.(Value)
|
||||
var lastValue Value
|
||||
for i, item := range items {
|
||||
v := item.(Value)
|
||||
d.PanicIfFalse(lastValue == nil || lastValue.Less(v))
|
||||
lastValue = v
|
||||
setData[i] = v
|
||||
}
|
||||
|
||||
set := newSet(newSetLeafSequence(vr, setData...))
|
||||
|
||||
@@ -1 +1 @@
|
||||
4:7.11:8s92pdafhd4hkhav6r4748u1rjlosh1k:5b1e9knhol2orv0a8ej6tvelc46jp92l:bsvid54jt8pjto211lcdl14tbfd39jmn:2:998se5i5mf15fld7f318818i6ie0c8rr:2
|
||||
4:7.12:8s92pdafhd4hkhav6r4748u1rjlosh1k:5b1e9knhol2orv0a8ej6tvelc46jp92l:bsvid54jt8pjto211lcdl14tbfd39jmn:2:998se5i5mf15fld7f318818i6ie0c8rr:2
|
||||
Reference in New Issue
Block a user