Merge pull request #4397 from dolthub/james/geom

print spatial types as hex in shells only
This commit is contained in:
James Cor
2022-09-22 16:24:15 -07:00
committed by GitHub
@@ -18,6 +18,7 @@ import (
"context"
"encoding/binary"
"errors"
"fmt"
"math"
"github.com/dolthub/go-mysql-server/sql"
@@ -320,6 +321,13 @@ func SqlColToStr(sqlType sql.Type, col interface{}) (string, error) {
} else {
return "false", nil
}
case sql.SpatialColumnType:
res, err := sqlType.SQL(sqlColToStrContext, nil, col)
hexRes := fmt.Sprintf("0x%X", res.Raw())
if err != nil {
return "", err
}
return hexRes, nil
default:
res, err := sqlType.SQL(sqlColToStrContext, nil, col)
if err != nil {