Skip to content

Commit de2df36

Browse files
committed
builtins: change crdb_internal.datums_to_bytes() to accept types.Any
Previously, crdb_internal.datums_to_bytes() required all arguments to have the same type. This patch removes that restriction to allow arguments of any type. Release note: None
1 parent 55f06d8 commit de2df36

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/sql/sem/builtins/builtins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4539,7 +4539,7 @@ value if you rely on the HLC for accuracy.`,
45394539
// Note that datums_to_bytes(a) == datums_to_bytes(b) iff (a IS NOT DISTINCT FROM b)
45404540
Info: "Converts datums into key-encoded bytes. " +
45414541
"Supports NULLs and all data types which may be used in index keys",
4542-
Types: tree.VariadicType{VarType: types.AnyElement},
4542+
Types: tree.VariadicType{VarType: types.Any},
45434543
ReturnType: tree.FixedReturnType(types.Bytes),
45444544
Fn: func(_ context.Context, _ *eval.Context, args tree.Datums) (tree.Datum, error) {
45454545
var out []byte

pkg/sql/sem/builtins/fixed_oids.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ var builtinOidsArray = []string{
12491249
1273: `crdb_internal.json_to_pb(pbname: string, json: jsonb) -> bytes`,
12501250
1274: `crdb_internal.read_file(uri: string) -> bytes`,
12511251
1275: `crdb_internal.write_file(data: bytes, uri: string) -> int`,
1252-
1276: `crdb_internal.datums_to_bytes(anyelement...) -> bytes`,
1252+
1276: `crdb_internal.datums_to_bytes(any...) -> bytes`,
12531253
1277: `crdb_internal.merge_statement_stats(input: jsonb[]) -> jsonb`,
12541254
1278: `crdb_internal.merge_transaction_stats(input: jsonb[]) -> jsonb`,
12551255
1279: `crdb_internal.merge_stats_metadata(input: jsonb[]) -> jsonb`,

0 commit comments

Comments
 (0)