Fix oversight in original coding of inline_function(): since
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Mar 2007 22:45:16 +0000 (22:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Mar 2007 22:45:16 +0000 (22:45 +0000)
commitcc0cac4a49b678e0c2b41020581036381385db5e
tree4934bbaea6ee5af6839dbaa66ee1352c7dc95ec0
parent46573e655f479ce546c4d3e4d9d747d88780796c
Fix oversight in original coding of inline_function(): since
check_sql_fn_retval allows binary-compatibility cases, the expression
extracted from an inline-able SQL function might have a type that is only
binary-compatible with the declared function result type.  To avoid possibly
changing the semantics of the expression, we should insert a RelabelType node
in such cases.  This has only been shown to have bad consequences in recent
8.1 and up releases, but I suspect there may be failure cases in the older
branches too, so patch it all the way back.  Per bug #3116 from Greg Mullane.

Along the way, fix an omission in eval_const_expressions_mutator: it failed
to copy the relabelformat field when processing a RelabelType.  No known
observable failures from this, but it definitely isn't intended behavior.
src/backend/optimizer/util/clauses.c