Inaccurate comment, for family-1 polymorphic UNKNOWN type arguments

Started by Himanshu Upadhyayaover 5 years ago2 messageshackers
Jump to latest
#1Himanshu Upadhyaya
upadhyaya.himanshu@gmail.com

Hi Hackers,

I observed that we have inaccurate comment in
enforce_generic_type_consistency.

if (!OidIsValid(elem_typeid))
{
if (allow_poly)
{
elem_typeid = ANYELEMENTOID;
array_typeid = ANYARRAYOID;
range_typeid = ANYRANGEOID;
}
else
{
/*
* Only way to get here is if all the
polymorphic args have
* UNKNOWN inputs
*/
*ereport(ERROR, *
...............
}
........
}
We reach the error condition even if there is any "anycompatible" parameter
is present (and that is of some known type say int32).
I think developer intend to report error if "we have all the family-1
polymorphic arguments as UNKNOWN".

Thoughts?

Please find attached the patch to fix this typo.

Thanks,
Himanshu
EnterpriseDB: http://www.enterprisedb.com

Attachments:

v1-0001-FIX-for-incorrect-comment-for-UNKNOWN-input-type-.patchtext/x-patch; charset=US-ASCII; name=v1-0001-FIX-for-incorrect-comment-for-UNKNOWN-input-type-.patchDownload+1-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Himanshu Upadhyaya (#1)
Re: Inaccurate comment, for family-1 polymorphic UNKNOWN type arguments

Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com> writes:

I observed that we have inaccurate comment in
enforce_generic_type_consistency.

Fair point, but that's not the only old comment that's not being careful
about it. I applied the attached.

regards, tom lane

Attachments:

improve-enforce_generic_type_consistency-comments.patchtext/x-diff; charset=us-ascii; name=improve-enforce_generic_type_consistency-comments.patchDownload+10-10