Skip to content

Commit

Permalink
fix 32 regress tests on debian
Browse files Browse the repository at this point in the history
  • Loading branch information
okbob committed Jul 19, 2020
1 parent 3677bb1 commit aac5839
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/typdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ param_get_desc(PLpgSQL_checkstate *cstate, Param *p)

if (!var->datatype ||
!OidIsValid(var->datatype->typoid) ||
var->datatype->typoid == 0xFFFFFFFF ||
var->datatype->typoid == p->paramtype)
{
TupleDesc rectupdesc;
Expand Down Expand Up @@ -250,7 +251,6 @@ param_get_desc(PLpgSQL_checkstate *cstate, Param *p)
return rettupdesc;
}


/*
* Try to deduce result tuple descriptor from polymorphic function
* like fce(.., anyelement, ..) returns anyelement
Expand Down Expand Up @@ -308,12 +308,15 @@ pofce_get_desc(PLpgSQL_checkstate *cstate,
PLpgSQL_var *var = (PLpgSQL_var *) cstate->estate->datums[dno];

/*
* Postgres 9.5 and older has not valid typoid for record
* variables.
* When we know a datatype, then we expect eq with param type.
* But sometimes a Oid of datatype is not valid - record type
* for some older releases. What is worse - sometimes Oid is 0
* or FFFFFFFF.
*/
if (var->dtype == PLPGSQL_DTYPE_REC &&
(!var->datatype ||
!OidIsValid(var->datatype->typoid) ||
var->datatype->typoid == 0xFFFFFFFF ||
var->datatype->typoid == p->paramtype))
{
PLpgSQL_rec *rec = (PLpgSQL_rec *) var;
Expand Down

0 comments on commit aac5839

Please sign in to comment.