mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-25 10:26:22 -06:00
Merge pull request #5672 from dolthub/aaron/doltdb-table-always-write-new-table-value
go/libraries/doltcore/doltdb: durable/table: Always write the table value we are refing. Ensures it always makes it across the GC safepoint.
This commit is contained in:
@@ -668,27 +668,7 @@ func (t nomsTable) DebugString(ctx context.Context) string {
|
||||
}
|
||||
|
||||
func refFromNomsValue(ctx context.Context, vrw types.ValueReadWriter, val types.Value) (types.Ref, error) {
|
||||
valRef, err := types.NewRef(val, vrw.Format())
|
||||
|
||||
if err != nil {
|
||||
return types.Ref{}, err
|
||||
}
|
||||
|
||||
targetVal, err := valRef.TargetValue(ctx, vrw)
|
||||
|
||||
if err != nil {
|
||||
return types.Ref{}, err
|
||||
}
|
||||
|
||||
if targetVal == nil {
|
||||
_, err = vrw.WriteValue(ctx, val)
|
||||
|
||||
if err != nil {
|
||||
return types.Ref{}, err
|
||||
}
|
||||
}
|
||||
|
||||
return valRef, err
|
||||
return vrw.WriteValue(ctx, val)
|
||||
}
|
||||
|
||||
func schemaFromRef(ctx context.Context, vrw types.ValueReadWriter, ref types.Ref) (schema.Schema, error) {
|
||||
|
||||
Reference in New Issue
Block a user