Skip to content

Commit caeea74

Browse files
committed
for resultTupleDesc use base type (can be domain)
1 parent bb29e79 commit caeea74

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/check_function.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,11 +992,13 @@ plpgsql_check_setup_fcinfo(plpgsql_check_info *cinfo,
992992
}
993993
else if (!IsPolymorphicType(cinfo->rettype))
994994
{
995-
if (get_typtype(cinfo->rettype) == TYPTYPE_COMPOSITE)
996-
resultTupleDesc = lookup_rowtype_tupdesc_copy(cinfo->rettype, -1);
995+
Oid rettype = getBaseType(cinfo->rettype);
996+
997+
if (get_typtype(rettype) == TYPTYPE_COMPOSITE)
998+
resultTupleDesc = lookup_rowtype_tupdesc_copy(rettype, -1);
997999
else
9981000
{
999-
*fake_rtd = cinfo->rettype == RECORDOID;
1001+
*fake_rtd = rettype == RECORDOID;
10001002

10011003
resultTupleDesc = CreateTemplateTupleDesc(1);
10021004

0 commit comments

Comments
 (0)