Skip to content

Commit 9efe1de

Browse files
committed
changefeedccl/avro: remove c and posix collated locales from avro test
Previously TestAvroSchema could choose from any valid collated string locale in its randomized testing. However, the C and POSIX locales are not supported for column types, so it does not make sense to test these. In fact, using them leads to errors, since these types can't be parsed. Epic: None Fixes: #140485 Release note: None
1 parent 2e7d5a6 commit 9efe1de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/ccl/changefeedccl/avro/avro_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,14 @@ func TestAvroSchema(t *testing.T) {
342342
switch typ.Family() {
343343
case types.StringFamily:
344344
collationTags := collatedstring.Supported()
345+
// "C" and "POSIX" locales are not allowed for collated string
346+
// columns in CRDB (see collatedstring logic tests),
347+
// so we don't expect these types to be emitted by changefeeds.
345348
randCollationTag := collationTags[rand.Intn(len(collationTags))]
349+
for randCollationTag == collatedstring.CCollationTag ||
350+
randCollationTag == collatedstring.PosixCollationTag {
351+
randCollationTag = collationTags[rand.Intn(len(collationTags))]
352+
}
346353
collatedType := types.MakeCollatedString(typ, randCollationTag)
347354
typesToTest = append(typesToTest, collatedType)
348355
}

0 commit comments

Comments
 (0)