Skip to content

Commit

Permalink
Allow boundaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-rieke committed Dec 15, 2023
1 parent 73bd795 commit 67c8748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions enginetest/mysqlshim/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions sql/plan/external_procedure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 67c8748

Please sign in to comment.