You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (o *IndexDef) hasPrefix(columns []string) bool {
if len(o.Columns) < len(columns) {
return false
}
for i := range o.Columns {
if o.Columns[i] != columns[i] {
return false
}
}
return true
}
This causes an index out of bounds exception if the length of o.Columns is longer than that of columns since we are iterating through o.Columns in the for loop.
This check should be if len(o.Columns) > len(columns) to make sure we are not iterating through the longer array.
After making this change, all the tests continue to pass as expected.
The text was updated successfully, but these errors were encountered:
In
index.go
there is the functionhasPrefix()
This causes an index out of bounds exception if the length of
o.Columns
is longer than that ofcolumns
since we are iterating througho.Columns
in thefor
loop.This check should be
if len(o.Columns) > len(columns)
to make sure we are not iterating through the longer array.After making this change, all the tests continue to pass as expected.
The text was updated successfully, but these errors were encountered: