Skip to content

Commit dd2b3a9

Browse files
committed
fix format errs and redundant edits
1 parent 6069cfa commit dd2b3a9

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

enginetest/queries/script_queries.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8720,8 +8720,6 @@ where
87208720
},
87218721
},
87228722
{
8723-
// This tests STRICT_ALL_TABLES mode specifically
8724-
Skip: false,
87258723
Name: "enums with zero strict all tables",
87268724
Dialect: "mysql",
87278725
SetUpScript: []string{

sql/expression/enum.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
package expression
1515

1616
import (
17-
"fmt"
18-
1917
"github.com/dolthub/go-mysql-server/sql"
2018
"github.com/dolthub/go-mysql-server/sql/types"
2119
)
@@ -82,7 +80,7 @@ func (e *EnumToString) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
8280
case string:
8381
str = v
8482
default:
85-
return nil, sql.ErrInvalidType.New(fmt.Sprintf("%T", val))
83+
return nil, sql.ErrInvalidType.New(types.Text.String())
8684
}
8785
return str, nil
8886
}

sql/planbuilder/ddl.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,17 +1299,14 @@ func validateDefaultExprs(col *sql.Column) error {
12991299
return nil
13001300
}
13011301

1302-
// Validate datetime/timestamp precision
1303-
if types.IsDatetimeType(col.Type) || types.IsTimestampType(col.Type) {
1304-
var colPrec int
1305-
if dt, ok := col.Type.(sql.DatetimeType); ok {
1306-
colPrec = dt.Precision()
1307-
}
1308-
if isValid, err := validatePrec(col.Default.Expr, colPrec); err != nil {
1309-
return err
1310-
} else if !isValid {
1311-
return sql.ErrInvalidColumnDefaultValue.New(col.Name)
1312-
}
1302+
var colPrec int
1303+
if dt, ok := col.Type.(sql.DatetimeType); ok {
1304+
colPrec = dt.Precision()
1305+
}
1306+
if isValid, err := validatePrec(col.Default.Expr, colPrec); err != nil {
1307+
return err
1308+
} else if !isValid {
1309+
return sql.ErrInvalidColumnDefaultValue.New(col.Name)
13131310
}
13141311

13151312
return nil

0 commit comments

Comments
 (0)