Skip to content

Commit 1146f2d

Browse files
committed
tree: generate a random tuple type in TestStringConcat
Previously, TestStringConcat was using the AnyTuple type to generate a randum datum. `AnyTuple` is not a real type that can be assigned to a value. Rather its a sentinel type used to represent any type that is a tuple. This worked before PR #153789, because randgen would pick random datums and then generate a new tuple type that matches the datums. But that behavior was broken for `NULL` values and did not match the behavior of the value decoder. Release note: none Fixes: #153789
1 parent 0eccabf commit 1146f2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/sql/sem/tree/expr_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ func TestStringConcat(t *testing.T) {
7575
defer leaktest.AfterTest(t)()
7676
defer log.Scope(t).Close(t)
7777
rng, _ := randutil.NewTestRand()
78+
79+
tuple := randgen.RandTupleFromSlice(rng, types.Scalar)
80+
7881
ctx := context.Background()
7982
evalCtx := eval.MakeTestingEvalContext(cluster.MakeTestingClusterSettings())
8083
defer evalCtx.Stop(ctx)
81-
for _, typ := range append([]*types.T{types.AnyTuple}, types.Scalar...) {
84+
for _, typ := range append([]*types.T{tuple}, types.Scalar...) {
8285
// Strings and Bytes are handled specially.
8386
if typ.Identical(types.String) || typ.Identical(types.Bytes) {
8487
continue

0 commit comments

Comments
 (0)