Skip to content

Commit 69a07bd

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent e30d14d commit 69a07bd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sql/expression/function/ceil_round_floor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// numericRetType returns the appropriate return type for numeric functions
3030
// like ROUND() and TRUNCATE() according to MySQL specification:
3131
// Integer types return BIGINT
32-
// Floating-point types or non-numeric types return DOUBLE
32+
// Floating-point types or non-numeric types return DOUBLE
3333
// DECIMAL values return DECIMAL
3434
func numericRetType(inputType sql.Type) sql.Type {
3535
if types.IsSigned(inputType) || types.IsUnsigned(inputType) {
@@ -41,7 +41,7 @@ func numericRetType(inputType sql.Type) sql.Type {
4141
} else if types.IsTextBlob(inputType) {
4242
return types.Float64 // DOUBLE for non-numeric types
4343
}
44-
44+
4545
// Default fallback
4646
return types.Float64
4747
}

sql/expression/function/truncate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (t *Truncate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
9292
ctx.Warn(mysql.ERTruncatedWrongValue, "%s", err.Error())
9393
}
9494
precision := prec.(int32)
95-
95+
9696
// MySQL cuts off at 30 for larger values
9797
// TODO: these limits are fine only because we can't handle decimals larger than this
9898
if precision > types.DecimalTypeMaxPrecision {
@@ -104,7 +104,7 @@ func (t *Truncate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
104104

105105
var res interface{}
106106
var tmp decimal.Decimal
107-
107+
108108
if precision < 0 {
109109
// For negative precision, we need to truncate digits to the left of decimal point
110110
// This is different from the decimal library's Truncate method
@@ -118,7 +118,7 @@ func (t *Truncate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
118118
// For positive precision, use the standard Truncate method
119119
tmp = val.(decimal.Decimal).Truncate(precision)
120120
}
121-
121+
122122
lType := t.LeftChild.Type()
123123
if types.IsSigned(lType) {
124124
res, _, err = types.Int64.Convert(ctx, tmp)

sql/expression/function/truncate_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func TestTruncate(t *testing.T) {
167167
t.Run(tt.name, func(t *testing.T) {
168168
var f sql.Expression
169169
var err error
170-
170+
171171
if tt.name == "invalid argument count - too few" {
172172
// Test invalid argument count - too few
173173
f, err = NewTruncate(tt.xExpr)
@@ -177,7 +177,7 @@ func TestTruncate(t *testing.T) {
177177
} else {
178178
f, err = NewTruncate(tt.xExpr, tt.dExpr)
179179
}
180-
180+
181181
if tt.err != nil {
182182
require.Error(t, err)
183183
require.True(t, tt.err.Is(err))
@@ -187,7 +187,7 @@ func TestTruncate(t *testing.T) {
187187

188188
res, err := f.Eval(sql.NewEmptyContext(), nil)
189189
require.NoError(t, err)
190-
190+
191191
// Special handling for decimal types
192192
if tt.name == "decimal input" {
193193
if dec, ok := res.(decimal.Decimal); ok {

0 commit comments

Comments
 (0)