some dead code in functioncmds.c

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: some dead code in functioncmds.c
Date: 2009-10-30 13:24:43
Message-ID: 162867790910300624y30f79fc9m6d17106116707e7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I found some strange code. Is code in "ELSE" part dead, or its bug?

if (stmt->returnType)
{
/* explicit RETURNS clause */
compute_return_type(stmt->returnType, languageOid,
&prorettype, &returnsSet);
if (OidIsValid(requiredResultType) && prorettype != requiredResultType)
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("function result type must be %s because of OUT parameters",
format_type_be(requiredResultType))));
}
else if (OidIsValid(requiredResultType))
{
/* default RETURNS clause from OUT parameters */
prorettype = requiredResultType;
returnsSet = false;
}
else
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
errmsg("function result type must be specified")));
/* Alternative possibility: default to RETURNS VOID */

/* WHY FOLOWING LINES? */
prorettype = VOIDOID;
returnsSet = false;
}

Regards
Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2009-10-30 13:28:44 Re: FTP/GIT/WWW server move
Previous Message shrish purohit 2009-10-30 12:25:32 Patch for automated partitioning