some dead code in functioncmds.c - Mailing list pgsql-hackers

From Pavel Stehule
Subject some dead code in functioncmds.c
Date
Msg-id 162867790910300624y30f79fc9m6d17106116707e7@mail.gmail.com
Whole thread Raw
Responses Re: some dead code in functioncmds.c
List 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
typemust 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")));    /*
Alternativepossibility: default to RETURNS VOID */
 

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

Regards
Pavel


pgsql-hackers by date:

Previous
From: shrish purohit
Date:
Subject: Patch for automated partitioning
Next
From: Dave Page
Date:
Subject: Re: FTP/GIT/WWW server move