fix panic

This commit is contained in:
James Cor
2023-03-07 11:59:52 -08:00
parent 44bc65b286
commit 2f23bfce0e
2 changed files with 5 additions and 1 deletions

View File

@@ -217,6 +217,9 @@ func PutField(ctx context.Context, ns tree.NodeStore, tb *val.TupleBuilder, i in
case val.CommitAddrEnc:
tb.PutCommitAddr(i, v.(hash.Hash))
case val.CellEnc:
if _, ok := v.([]byte); ok {
v = deserializeGeometry(v.([]byte))
}
tb.PutCell(i, ZCell(v.(types.GeometryValue)))
default:
panic(fmt.Sprintf("unknown encoding %v %v", enc, v))

View File

@@ -18,6 +18,7 @@ import (
"bytes"
"context"
"fmt"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/index"
"io"
"strings"
@@ -211,7 +212,7 @@ func BuildSecondaryProllyIndex(ctx context.Context, vrw types.ValueReadWriter, n
keyBld.PutRaw(to, k.GetField(from))
} else {
from -= pkLen
keyBld.PutRaw(to, v.GetField(from))
index.PutField(ctx, ns, keyBld, to, v.GetField(from))
}
}