Skip to content

Commit ad215c7

Browse files
author
James Cor
committed
Merge branch 'james/enum' of https://github.com/dolthub/go-mysql-server into james/enum
2 parents ae36e15 + b665162 commit ad215c7

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

enginetest/queries/script_queries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7690,11 +7690,11 @@ where
76907690
},
76917691
Assertions: []ScriptTestAssertion{
76927692
{
7693-
Query: "insert into t values (1, 500)",
7693+
Query: "insert into t values (1, 500)",
76947694
ExpectedErrStr: "value 500 is not valid for this Enum",
76957695
},
76967696
{
7697-
Query: "insert into t values (1, -1)",
7697+
Query: "insert into t values (1, -1)",
76987698
ExpectedErrStr: "value -1 is not valid for this Enum",
76997699
},
77007700
},

sql/expression/enum.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,7 +20,7 @@ import (
2020

2121
// EnumToString is an expression that converts an enum value to a string.
2222
type EnumToString struct {
23-
Enum sql.Expression
23+
Enum sql.Expression
2424
}
2525

2626
var _ sql.Expression = (*EnumToString)(nil)
@@ -90,4 +90,4 @@ func (e *EnumToString) String() string {
9090
// DebugString implements the sql.Expression interface.
9191
func (e *EnumToString) DebugString() string {
9292
return sql.DebugString(e.Enum)
93-
}
93+
}

sql/planbuilder/factory.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
package planbuilder
1616

1717
import (
18+
"strings"
19+
1820
"github.com/dolthub/go-mysql-server/sql/types"
19-
"strings"
2021

2122
"github.com/dolthub/go-mysql-server/sql"
2223
"github.com/dolthub/go-mysql-server/sql/expression"

sql/types/enum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (t EnumType) At(idx int) (string, bool) {
301301
return "", false
302302
}
303303
// The elements listed in the column specification are assigned index numbers, beginning with 1.
304-
return t.idxToVal[idx - 1], true
304+
return t.idxToVal[idx-1], true
305305
}
306306

307307
// CharacterSet implements EnumType interface.

0 commit comments

Comments
 (0)