Skip to content

Commit cb32622

Browse files
craig[bot]rharding6373
andcommitted
Merge #140532
140532: changefeedccl/avro: remove c and posix collated locales from avro test r=tbg a=rharding6373 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 Co-authored-by: rharding6373 <[email protected]>
2 parents 3c19abb + 9efe1de commit cb32622

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)