From 67c87487227f37be3675397a09bfe02686da82ff Mon Sep 17 00:00:00 2001 From: Joel Rieke Date: Thu, 14 Dec 2023 20:21:54 -0800 Subject: [PATCH] Allow boundaries. --- enginetest/mysqlshim/table.go | 4 ++-- sql/plan/external_procedure.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/enginetest/mysqlshim/table.go b/enginetest/mysqlshim/table.go index 41781a8d1d..f0cfc1087d 100644 --- a/enginetest/mysqlshim/table.go +++ b/enginetest/mysqlshim/table.go @@ -146,11 +146,11 @@ func (t Table) Truncate(ctx *sql.Context) (int, error) { } err = t.db.shim.Exec("", fmt.Sprintf("TRUNCATE TABLE `%s`;", t.name)) if int64RowCount, ok := rowCount.(int64); ok { - if int64RowCount > math.MinInt && int64RowCount < math.MaxInt { + if int64RowCount >= math.MinInt && int64RowCount <= math.MaxInt { return int(int64RowCount), err } } else if uint64RowCount, ok := rowCount.(uint64); ok { - if uint64RowCount < math.MaxInt { + if uint64RowCount <= math.MaxInt { return int(uint64RowCount), err } } diff --git a/sql/plan/external_procedure.go b/sql/plan/external_procedure.go index 73aca74b5a..ae82e9c0cb 100644 --- a/sql/plan/external_procedure.go +++ b/sql/plan/external_procedure.go @@ -175,12 +175,12 @@ func (n *ExternalProcedure) processParam(ctx *sql.Context, funcParamType reflect if strconv.IntSize == 32 { convOk := false if int32ExprParamVal, ok := exprParamVal.(int32); ok { - if int32ExprParamVal < math.MaxInt32 && int32ExprParamVal > math.MinInt32 { + if int32ExprParamVal <= math.MaxInt32 && int32ExprParamVal >= math.MinInt32 { exprParamVal = int(int32ExprParamVal) convOk = true } } else if uint32ExprParamVal, ok := exprParamVal.(uint32); ok { - if uint32ExprParamVal < math.MaxUint32 { + if uint32ExprParamVal <= math.MaxUint32 { exprParamVal = int(uint32ExprParamVal) convOk = true }