Skip to content

Commit ca6dda5

Browse files
committed
fix
1 parent 0d177fc commit ca6dda5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/types/enum.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ func (t EnumType) Zero() interface{} {
287287
// At implements EnumType interface.
288288
func (t EnumType) At(index int) (string, bool) {
289289
// The elements listed in the column specification are assigned index numbers, beginning with 1.
290-
if index == 0 {
290+
index -= 1
291+
if index == -1 {
291292
return "", true
292-
} else if index > len(t.indexToVal) {
293+
} else if index >= len(t.indexToVal) {
293294
return "", false
294295
}
295296
return t.indexToVal[index], true

0 commit comments

Comments
 (0)