Skip to content

Commit 7d10ef1

Browse files
committed
internal/sqlsmith: don't generate UDFs with collated strings
Collated strings are not a valid return type for UDFs in Postgres, so they are disallowed. We already had the check in most places, and the only exception was if we created a mutation with a single RETURNING column of collated string type. This omission is now fixed. Release note: None
1 parent 1f8fa96 commit 7d10ef1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/internal/sqlsmith/relational.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ func (s *Smither) makeCreateFunc() (cf *tree.CreateRoutine, ok bool) {
10431043
// If the rtype isn't a RECORD, change it to rrefs or RECORD depending
10441044
// how many columns there are to avoid return type mismatch errors.
10451045
if rtyp != types.AnyTuple {
1046-
if len(rrefs) == 1 && s.coin() {
1046+
if len(rrefs) == 1 && s.coin() && rrefs[0].typ.Family() != types.CollatedStringFamily {
10471047
rtyp = rrefs[0].typ
10481048
} else {
10491049
rtyp = types.AnyTuple

0 commit comments

Comments
 (0)