Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions go/store/val/value_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package val
import (
"context"
"database/sql/driver"
"unsafe"

"github.com/dolthub/dolt/go/store/hash"

"github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/go-mysql-server/sql/types"

"github.com/dolthub/dolt/go/store/hash"
)

const BytePeekLength = 128
Expand Down Expand Up @@ -88,7 +89,7 @@ func (t *TextStorage) Unwrap(ctx context.Context) (string, error) {
if err != nil {
return "", err
}
return string(buf), nil
return *(*string)(unsafe.Pointer(&buf)), nil
}

func (t *TextStorage) UnwrapAny(ctx context.Context) (interface{}, error) {
Expand Down Expand Up @@ -132,7 +133,7 @@ func (t *TextStorage) Value() (driver.Value, error) {
if err != nil {
return "", err
}
return string(buf), nil
return *(*string)(unsafe.Pointer(&buf)), nil
}

type ByteArray struct {
Expand Down Expand Up @@ -198,7 +199,8 @@ func (b *ByteArray) ToString(ctx context.Context) (string, error) {
if len(buf) < toShow {
toShow = len(buf)
}
return string(buf[:toShow]), nil
res := buf[:toShow]
return *(*string)(unsafe.Pointer(&res)), nil
}

// Hash implements sql.AnyWrapper by returning the Dolt hash.
Expand Down
Loading