We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d177fc commit ca6dda5Copy full SHA for ca6dda5
sql/types/enum.go
@@ -287,9 +287,10 @@ func (t EnumType) Zero() interface{} {
287
// At implements EnumType interface.
288
func (t EnumType) At(index int) (string, bool) {
289
// The elements listed in the column specification are assigned index numbers, beginning with 1.
290
- if index == 0 {
+ index -= 1
291
+ if index == -1 {
292
return "", true
- } else if index > len(t.indexToVal) {
293
+ } else if index >= len(t.indexToVal) {
294
return "", false
295
}
296
return t.indexToVal[index], true
0 commit comments