Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#57672
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
gengliqi authored and ti-chi-bot committed Nov 25, 2024
1 parent f00a584 commit 1a0554b
Show file tree
Hide file tree
Showing 4 changed files with 3,399 additions and 2 deletions.
2 changes: 1 addition & 1 deletion expression/builtin_math.go
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ func (b *builtinRadiansSig) evalReal(row chunk.Row) (float64, bool, error) {
if isNull || err != nil {
return 0, isNull, err
}
return x * math.Pi / 180, false, nil
return x * (math.Pi / 180), false, nil
}

type sinFunctionClass struct {
Expand Down
2 changes: 2 additions & 0 deletions expression/builtin_math_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ func TestRadians(t *testing.T) {
{float64(180), float64(math.Pi)},
{-360, -2 * float64(math.Pi)},
{"180", float64(math.Pi)},
{float64(1.0e308), float64(1.7453292519943295e306)},
{float64(23), float64(0.4014257279586958)},
}

Dtbl := tblToDtbl(tbl)
Expand Down
2 changes: 1 addition & 1 deletion expression/builtin_math_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (b *builtinRadiansSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column
if result.IsNull(i) {
continue
}
f64s[i] = f64s[i] * math.Pi / 180
f64s[i] = f64s[i] * (math.Pi / 180)
}
return nil
}
Expand Down
Loading

0 comments on commit 1a0554b

Please sign in to comment.