Skip to content

Commit

Permalink
[mysql] Ignore POINT column SRID values (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie authored Jun 21, 2024
1 parent d0e4071 commit 14bb42a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/mysql/schema/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package schema
import (
"encoding/binary"
"fmt"
"log/slog"
"math"
"time"
)
Expand Down Expand Up @@ -125,9 +126,7 @@ func ConvertValue(value any, colType DataType) (any, error) {
return nil, fmt.Errorf("expected []byte with length 25, length is %d", len(bytes))
}

if srid := binary.LittleEndian.Uint32(bytes[0:4]); srid != 0 {
return nil, fmt.Errorf("expected SRID to be 0, SRID is %d", srid)
}
slog.Info("Point SRID", slog.Any("value", binary.LittleEndian.Uint32(bytes[0:4])))

if byteOrder := bytes[5]; byteOrder != 1 {
return nil, fmt.Errorf("expected byte order to be 1 (little-endian), byte order is %d", byteOrder)
Expand Down

0 comments on commit 14bb42a

Please sign in to comment.