Skip to content

Commit

Permalink
Merge pull request #15666 from mjibson/datum-alloc
Browse files Browse the repository at this point in the history
sqlbase: remove unused DatumAlloc arg in DecodeKeyVals
  • Loading branch information
maddyblue authored May 8, 2017
2 parents f62b86a + 449968a commit c2b6917
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/sqlbase/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func ConvertBatchError(tableDesc *TableDescriptor, b *client.Batch) error {
}
dirs = append(dirs, convertedDir)
}
if _, err := DecodeKeyVals(&alloc, vals, dirs, key); err != nil {
if _, err := DecodeKeyVals(vals, dirs, key); err != nil {
return err
}
decodedVals := make([]parser.Datum, len(vals))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sqlbase/rowfetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (rf *RowFetcher) ProcessKV(
// This is a unique index; decode the extra column values from
// the value.
var err error
valueBytes, err = DecodeKeyVals(&rf.alloc, rf.extraVals, nil, valueBytes)
valueBytes, err = DecodeKeyVals(rf.extraVals, nil, valueBytes)
if err != nil {
return "", "", err
}
Expand Down
12 changes: 5 additions & 7 deletions pkg/sql/sqlbase/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ func DecodeIndexKey(
}

length := int(ancestor.SharedPrefixLen)
key, err = DecodeKeyVals(a, vals[:length], colDirs[:length], key)
key, err = DecodeKeyVals(vals[:length], colDirs[:length], key)
if err != nil {
return nil, false, err
}
Expand All @@ -733,7 +733,7 @@ func DecodeIndexKey(
return nil, false, nil
}

key, err = DecodeKeyVals(a, vals, colDirs, key)
key, err = DecodeKeyVals(vals, colDirs, key)
if err != nil {
return nil, false, err
}
Expand All @@ -750,9 +750,7 @@ func DecodeIndexKey(
// DecodeKeyVals decodes the values that are part of the key. The decoded
// values are stored in the vals. If this slice is nil, the direction
// used will default to encoding.Ascending.
func DecodeKeyVals(
a *DatumAlloc, vals []EncDatum, directions []encoding.Direction, key []byte,
) ([]byte, error) {
func DecodeKeyVals(vals []EncDatum, directions []encoding.Direction, key []byte) ([]byte, error) {
if directions != nil && len(directions) != len(vals) {
return nil, errors.Errorf("encoding directions doesn't parallel val: %d vs %d.",
len(directions), len(vals))
Expand Down Expand Up @@ -816,7 +814,7 @@ func ExtractIndexKey(
return nil, errors.Errorf("descriptor did not match key")
}
} else {
key, err = DecodeKeyVals(a, values, dirs, key)
key, err = DecodeKeyVals(values, dirs, key)
if err != nil {
return nil, err
}
Expand All @@ -839,7 +837,7 @@ func ExtractIndexKey(
return nil, err
}
}
_, err = DecodeKeyVals(a, extraValues, dirs, extraKey)
_, err = DecodeKeyVals(extraValues, dirs, extraKey)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c2b6917

Please sign in to comment.