contrib/dblink regression test failure fix

Started by Joe Conwayalmost 24 years ago4 messagespatches
Jump to latest
#1Joe Conway
mail@joeconway.com

Attached is a patch to fix the current regression test failure for
contrib/dblink. The failure was induced by recent changes to cast behavior. If
possible, please apply before creating the beta2 tarball.

Thanks,

Joe

Attachments:

dblink-regr-cast-fix.1.patchtext/plain; name=dblink-regr-cast-fix.1.patchDownload+12-12
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#1)
Re: contrib/dblink regression test failure fix

Joe Conway <mail@joeconway.com> writes:

Attached is a patch to fix the current regression test failure for
contrib/dblink. The failure was induced by recent changes to cast
behavior.

Actually, I was going to suggest modifying the declaration of the
dblink function(s) to take integer instead of int2. Is there a
really good reason why they take int2? If not, there's little point
in putting up with a notational headache throughout the 7.3 cycle.

The problem should go away again in 7.4, when we tweak the parser to
initially type "2" as "2::int2" ... but for now the path of least
resistance would seem to be avoiding declaring functions to take int2.

regards, tom lane

#3Joe Conway
mail@joeconway.com
In reply to: Joe Conway (#1)
Re: contrib/dblink regression test failure fix

Tom Lane wrote:

Actually, I was going to suggest modifying the declaration of the
dblink function(s) to take integer instead of int2. Is there a
really good reason why they take int2? If not, there's little point
in putting up with a notational headache throughout the 7.3 cycle.

The problem should go away again in 7.4, when we tweak the parser to
initially type "2" as "2::int2" ... but for now the path of least
resistance would seem to be avoiding declaring functions to take int2.

Good point. I only used int2 to be consistent with pg_class.relnatts.

Here is a revised patch. This uses an int4 input with a bit of checking to be
sure the given value fits in an int2 variable. This seemed the easiest and
safest approach. Please apply if there are no objections.

Thanks,

Joe

Attachments:

dblink-regr-cast-fix.2.patchtext/plain; name=dblink-regr-cast-fix.2.patchDownload+42-39
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joe Conway (#3)
Re: contrib/dblink regression test failure fix

Joe Conway <mail@joeconway.com> writes:

Here is a revised patch. This uses an int4 input with a bit of checking to be
sure the given value fits in an int2 variable. This seemed the easiest and
safest approach. Please apply if there are no objections.

Okay, patch applied --- I figured we'd better fast-track this into
beta2, since otherwise people might have a problem upgrading later.

regards, tom lane