Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.26.2

require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
github.com/cockroachdb/apd/v3 v3.2.3
github.com/cockroachdb/errors v1.7.5
github.com/dolthub/dolt/go v0.40.5-0.20260505174628-1b8bc4a1f0fd
github.com/dolthub/dolt/go v0.40.5-0.20260505235150-c334899b1138
github.com/dolthub/eventsapi_schema v0.0.0-20260310172945-37a9265ade69
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.20.1-0.20260504234906-b4fc3a6e3cc5
github.com/dolthub/go-mysql-server v0.20.1-0.20260505215953-bee2a70fec58
github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216
github.com/dolthub/vitess v0.0.0-20260504232330-bcb1b9015c48
github.com/dolthub/vitess v0.0.0-20260505163811-77e5224be390
github.com/fatih/color v1.13.0
github.com/goccy/go-json v0.10.2
github.com/gogo/protobuf v1.3.2
Expand All @@ -31,7 +31,6 @@ require (
github.com/pierrre/geohash v1.0.0
github.com/pkg/profile v1.5.0
github.com/sergi/go-diff v1.1.0
github.com/shopspring/decimal v1.4.0
github.com/sirupsen/logrus v1.8.3
github.com/stretchr/testify v1.11.1
github.com/twpayne/go-geom v1.3.6
Expand Down Expand Up @@ -171,6 +170,7 @@ require (
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/shirou/gopsutil/v4 v4.25.12 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
Expand Down
17 changes: 8 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/T
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a h1:9VFe4R5FRCUyidB1rdm3XdCRVuD/75P7Y4PtzEGhEE4=
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cockroachdb/apd/v3 v3.2.3 h1:4Zx+I3R35bFXMnltzmjP79i2cravE4jTRL6ps9Aux80=
github.com/cockroachdb/apd/v3 v3.2.3/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4=
github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM=
github.com/cockroachdb/errors v1.7.5 h1:ptyO1BLW+sBxwBTSKJfS6kGzYCVKhI7MyBhoXAnPIKM=
Expand Down Expand Up @@ -245,8 +245,8 @@ github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 h1:I
github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12/go.mod h1:rN7X8BHwkjPcfMQQ2QTAq/xM3leUSGLfb+1Js7Y6TVo=
github.com/dolthub/dolt-mcp v0.3.4 h1:AyG5cw+fNWXDHXujtQnqUPZrpWtPg6FN6yYtjv1pP44=
github.com/dolthub/dolt-mcp v0.3.4/go.mod h1:bCZ7KHvDYs+M0e+ySgmGiNvLhcwsN7bbf5YCyillLrk=
github.com/dolthub/dolt/go v0.40.5-0.20260505174628-1b8bc4a1f0fd h1:nWpxjJMGeNNrKnMzqcihLdsOcdzHPZXw1VfwKrh1eHU=
github.com/dolthub/dolt/go v0.40.5-0.20260505174628-1b8bc4a1f0fd/go.mod h1:bjYYYVBPSlOKvpsX5AdGftveZQCIC5cyqvFUK5I+0CQ=
github.com/dolthub/dolt/go v0.40.5-0.20260505235150-c334899b1138 h1:ON9buSp8ADonlYXELGoct3+3gZ8czXbx3ILogqUS8ok=
github.com/dolthub/dolt/go v0.40.5-0.20260505235150-c334899b1138/go.mod h1:r9y445V5FvEh1GPGko1NSspH9pzdN1yLml9OvELAUbQ=
github.com/dolthub/eventsapi_schema v0.0.0-20260310172945-37a9265ade69 h1:JShhbqMw26nKx3pqqu/cFxOpzBkN+4elVhzuUfgDw2k=
github.com/dolthub/eventsapi_schema v0.0.0-20260310172945-37a9265ade69/go.mod h1:SSLraQS/jGLYFgff3vuZ+JbVUct6vyEeMzjLBqWqoyM=
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
Expand All @@ -255,8 +255,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20260412212219-49724d547866 h1:U6gSf5I0e6h6GP1/5Sa7D2lWW1CWfcVPtY5wkyHq6jY=
github.com/dolthub/go-icu-regex v0.0.0-20260412212219-49724d547866/go.mod h1:F3cnm+vMRK1HaU6+rNqQrOCyR03HHhR1GWG2gnPOqaE=
github.com/dolthub/go-mysql-server v0.20.1-0.20260504234906-b4fc3a6e3cc5 h1:F7prHhrdLPuzacr9+hpklMxZ4Q2M2dqsKzxX8FqiRXs=
github.com/dolthub/go-mysql-server v0.20.1-0.20260504234906-b4fc3a6e3cc5/go.mod h1:hhGHXWslZ2AFzPkgJqoHtH6fZ/lNMk25SAe2RHKpQLU=
github.com/dolthub/go-mysql-server v0.20.1-0.20260505215953-bee2a70fec58 h1:vaw9NBd3aI2qo09GfUNktff8zpTFePIeZw+upfVb4qc=
github.com/dolthub/go-mysql-server v0.20.1-0.20260505215953-bee2a70fec58/go.mod h1:uE//4hYOi/1zIgOYgr8D+u7OvDfI4yPXFsL4dTZWk5I=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
github.com/dolthub/ishell v0.0.0-20260414231531-5f031e3e9037 h1:oIW9HwuWrhxv+4HZxA+QQSKHLqWFyXZ2FmNjUYwkdiM=
Expand All @@ -267,8 +267,8 @@ github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1 h1:GY17cGA4
github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1/go.mod h1:qnrZP3/1slFl2Bq5yw38HLOsArZareGwdpEceriblLc=
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 h1:JWkKRE4EHUcEVQCMRBej8DYxjYjRz/9MdF/NNQh0o70=
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216/go.mod h1:e/FIZVvT2IR53HBCAo41NjqgtEnjMJGKca3Y/dAmZaA=
github.com/dolthub/vitess v0.0.0-20260504232330-bcb1b9015c48 h1:znkwaIJnYUf9kL6hNctwWOaKDH0h1jWevwdmo0Otojo=
github.com/dolthub/vitess v0.0.0-20260504232330-bcb1b9015c48/go.mod h1:dKAkzdfRkAudpc0g8JOQ0eiEjV83TYIFz/yNIEdcjXM=
github.com/dolthub/vitess v0.0.0-20260505163811-77e5224be390 h1:FjUnJYan3i3mrk/i+qENwFOQhA+XfH+wgAucbgi/4sQ=
github.com/dolthub/vitess v0.0.0-20260505163811-77e5224be390/go.mod h1:dKAkzdfRkAudpc0g8JOQ0eiEjV83TYIFz/yNIEdcjXM=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
Expand Down Expand Up @@ -670,7 +670,6 @@ github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTw
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
2 changes: 1 addition & 1 deletion postgres/parser/encoding/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"math/big"
"unsafe"

"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion postgres/parser/encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"fmt"
"unsafe"

"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"

"github.com/dolthub/doltgresql/postgres/parser/uuid"
Expand Down
2 changes: 1 addition & 1 deletion postgres/parser/json/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
package json

import (
"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"

"github.com/dolthub/doltgresql/postgres/parser/encoding"
Expand Down
2 changes: 1 addition & 1 deletion postgres/parser/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"unicode/utf8"
"unsafe"

"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"

"github.com/dolthub/doltgresql/postgres/parser/encoding"
Expand Down
4 changes: 2 additions & 2 deletions postgres/parser/sem/tree/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"unicode"
"unsafe"

"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
"github.com/lib/pq/oid"

Expand Down Expand Up @@ -563,7 +563,7 @@ func (d *DDecimal) IsComposite() bool {

// Check if d is divisible by 10.
var r big.Int
r.Rem(&d.Decimal.Coeff, bigTen)
r.Rem((&d.Decimal.Coeff).MathBigInt(), bigTen)
return r.Sign() == 0
}

Expand Down
2 changes: 1 addition & 1 deletion postgres/parser/sem/tree/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"fmt"
"math"

"github.com/cockroachdb/apd/v2"
"github.com/cockroachdb/apd/v3"

"github.com/dolthub/doltgresql/postgres/parser/pgcode"
"github.com/dolthub/doltgresql/postgres/parser/pgerror"
Expand Down
2 changes: 1 addition & 1 deletion server/analyzer/resolve_values_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func ResolveValuesTypes(ctx *sql.Context, a *analyzer.Analyzer, node sql.Node, s
// MIN now returns numeric, so GroupBy produces numeric. But the
// Project's GetField still says int4 because its tableId=GroupBy,
// which wasn't in transformedVDTs. At runtime this causes a panic
// because the actual value is decimal.Decimal but the type says int32.
// because the actual value is apd.Decimal but the type says int32.
//
// This pass catches those: for each GetField, check if its type
// disagrees with what the child node actually produces.
Expand Down
4 changes: 2 additions & 2 deletions server/analyzer/type_sanitizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strings"
"time"

"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/go-mysql-server/sql/analyzer"
Expand All @@ -27,7 +28,6 @@ import (
"github.com/dolthub/go-mysql-server/sql/transform"
"github.com/dolthub/go-mysql-server/sql/types"
"github.com/dolthub/vitess/go/vt/proto/query"
"github.com/shopspring/decimal"

pgexprs "github.com/dolthub/doltgresql/server/expression"
"github.com/dolthub/doltgresql/server/functions/framework"
Expand Down Expand Up @@ -173,7 +173,7 @@ func typeSanitizerLiterals(ctx *sql.Context, gmsLiteral *expression.Literal) (sq
}
return pgexprs.NewRawLiteralFloat64(newVal.(float64)), transform.NewTree, nil
case query.Type_DECIMAL:
dec, ok := gmsLiteral.Value().(decimal.Decimal)
dec, ok := gmsLiteral.Value().(apd.Decimal)
if !ok {
return nil, transform.NewTree, errors.Errorf("SANITIZER: expected decimal type: %T", gmsLiteral.Value())
}
Expand Down
10 changes: 1 addition & 9 deletions server/ast/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql/expression"
vitess "github.com/dolthub/vitess/go/vt/sqlparser"
"github.com/shopspring/decimal"
"github.com/sirupsen/logrus"

"github.com/dolthub/doltgresql/core/id"
Expand Down Expand Up @@ -518,15 +517,8 @@ func nodeExpr(ctx *Context, node tree.Expr) (vitess.Expr, error) {
Expression: pgexprs.NewRawLiteralDate(t),
}, nil
case *tree.DDecimal:
// TODO: should we use apd.Decimal for Numeric type values?
// |Coeff| is always positive, so need to |Negative| to negate the big.Int
bigInt := &node.Coeff
if node.Negative {
bigInt = bigInt.Neg(bigInt)
}
return vitess.InjectedExpr{
Expression: pgexprs.NewRawLiteralNumeric(decimal.NewFromBigInt(bigInt, node.Exponent)),
}, nil
Expression: pgexprs.NewRawLiteralNumeric(node.Decimal)}, nil
case *tree.DEnum:
return nil, errors.Errorf("the statement is not yet supported")
case *tree.DFloat:
Expand Down
9 changes: 7 additions & 2 deletions server/cast/float32.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package cast
import (
"math"

"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql"
"github.com/shopspring/decimal"

"github.com/dolthub/doltgresql/server/functions/framework"
pgtypes "github.com/dolthub/doltgresql/server/types"
Expand Down Expand Up @@ -70,7 +70,12 @@ func float32Assignment() {
FromType: pgtypes.Float32,
ToType: pgtypes.Numeric,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
return pgtypes.GetNumericValueWithTypmod(decimal.NewFromFloat(float64(val.(float32))), targetType.GetAttTypMod())
d := new(apd.Decimal)
err := d.Scan(float64(val.(float32)))
if err != nil {
return nil, err
}
return pgtypes.GetNumericValueWithTypmod(*d, targetType.GetAttTypMod())
},
})
}
Expand Down
9 changes: 7 additions & 2 deletions server/cast/float64.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package cast
import (
"math"

"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql"
"github.com/shopspring/decimal"

"github.com/dolthub/doltgresql/server/functions/framework"
pgtypes "github.com/dolthub/doltgresql/server/types"
Expand Down Expand Up @@ -76,7 +76,12 @@ func float64Assignment() {
FromType: pgtypes.Float64,
ToType: pgtypes.Numeric,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
return pgtypes.GetNumericValueWithTypmod(decimal.NewFromFloat(val.(float64)), targetType.GetAttTypMod())
d := new(apd.Decimal)
err := d.Scan(val.(float64))
if err != nil {
return nil, err
}
return pgtypes.GetNumericValueWithTypmod(*d, targetType.GetAttTypMod())
},
})
}
4 changes: 2 additions & 2 deletions server/cast/int16.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package cast

import (
"github.com/cockroachdb/apd/v3"
"github.com/dolthub/go-mysql-server/sql"
"github.com/shopspring/decimal"

"github.com/dolthub/doltgresql/core/id"
"github.com/dolthub/doltgresql/server/functions/framework"
Expand Down Expand Up @@ -62,7 +62,7 @@ func int16Implicit() {
FromType: pgtypes.Int16,
ToType: pgtypes.Numeric,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
return decimal.NewFromInt(int64(val.(int16))), nil
return pgtypes.GetNumericValueWithTypmod(*apd.New(int64(val.(int16)), 0), targetType.GetAttTypMod())
},
})
framework.MustAddImplicitTypeCast(framework.TypeCast{
Expand Down
4 changes: 2 additions & 2 deletions server/cast/int32.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
package cast

import (
"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"

"github.com/dolthub/go-mysql-server/sql"
"github.com/shopspring/decimal"

"github.com/dolthub/doltgresql/core/id"
"github.com/dolthub/doltgresql/server/functions/framework"
Expand Down Expand Up @@ -84,7 +84,7 @@ func int32Implicit() {
FromType: pgtypes.Int32,
ToType: pgtypes.Numeric,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
return decimal.NewFromInt(int64(val.(int32))), nil
return pgtypes.GetNumericValueWithTypmod(*apd.New(int64(val.(int32)), 0), targetType.GetAttTypMod())
},
})
framework.MustAddImplicitTypeCast(framework.TypeCast{
Expand Down
15 changes: 8 additions & 7 deletions server/cast/int64.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package cast

import (
"github.com/cockroachdb/errors"
"math"

"github.com/cockroachdb/apd/v3"
"github.com/cockroachdb/errors"
"github.com/dolthub/go-mysql-server/sql"
"github.com/shopspring/decimal"

"github.com/dolthub/doltgresql/core/id"
"github.com/dolthub/doltgresql/server/functions/framework"
Expand Down Expand Up @@ -75,14 +76,14 @@ func int64Implicit() {
FromType: pgtypes.Int64,
ToType: pgtypes.Numeric,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
return decimal.NewFromInt(val.(int64)), nil
return pgtypes.GetNumericValueWithTypmod(*apd.New(val.(int64), 0), targetType.GetAttTypMod())
},
})
framework.MustAddImplicitTypeCast(framework.TypeCast{
FromType: pgtypes.Int64,
ToType: pgtypes.Oid,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
if val.(int64) > pgtypes.MaxUint32 || val.(int64) < 0 {
if val.(int64) > int64(math.MaxUint32) || val.(int64) < 0 {
return nil, errOutOfRange.New(targetType.String())
}
if internalID := id.Cache().ToInternal(uint32(val.(int64))); internalID.IsValid() {
Expand All @@ -95,7 +96,7 @@ func int64Implicit() {
FromType: pgtypes.Int64,
ToType: pgtypes.Regclass,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
if val.(int64) > pgtypes.MaxUint32 || val.(int64) < 0 {
if val.(int64) > int64(math.MaxUint32) || val.(int64) < 0 {
return nil, errOutOfRange.New(targetType.String())
}
if internalID := id.Cache().ToInternal(uint32(val.(int64))); internalID.IsValid() {
Expand All @@ -108,7 +109,7 @@ func int64Implicit() {
FromType: pgtypes.Int64,
ToType: pgtypes.Regproc,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
if val.(int64) > pgtypes.MaxUint32 || val.(int64) < 0 {
if val.(int64) > int64(math.MaxUint32) || val.(int64) < 0 {
return nil, errOutOfRange.New(targetType.String())
}
if internalID := id.Cache().ToInternal(uint32(val.(int64))); internalID.IsValid() {
Expand All @@ -121,7 +122,7 @@ func int64Implicit() {
FromType: pgtypes.Int64,
ToType: pgtypes.Regtype,
Function: func(ctx *sql.Context, val any, targetType *pgtypes.DoltgresType) (any, error) {
if val.(int64) > pgtypes.MaxUint32 || val.(int64) < 0 {
if val.(int64) > int64(math.MaxUint32) || val.(int64) < 0 {
return nil, errOutOfRange.New(targetType.String())
}
if internalID := id.Cache().ToInternal(uint32(val.(int64))); internalID.IsValid() {
Expand Down
Loading
Loading