1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

Fix a passel of problems with incorrect calls to typinput and typoutput

functions, which would lead to trouble with datatypes that paid attention
to the typelem or typmod parameters to these functions.  In particular,
incorrect code in pg_aggregate.c explains the platform-specific failures
that have been reported in NUMERIC avg().
This commit is contained in:
Tom Lane
2000-01-15 22:43:25 +00:00
parent 0f4a586821
commit 584e646ad8
11 changed files with 89 additions and 50 deletions

View File

@@ -3,7 +3,7 @@
* procedural language (PL)
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.17 2000/01/10 17:14:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.18 2000/01/15 22:43:23 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -65,7 +65,6 @@ typedef struct pltcl_proc_desc
char *proname;
FmgrInfo result_in_func;
Oid result_in_elem;
int result_in_len;
int nargs;
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
Oid arg_out_elem[FUNC_MAX_ARGS];
@@ -501,8 +500,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
}
fmgr_info(typeStruct->typinput, &(prodesc->result_in_func));
prodesc->result_in_elem = (Oid) (typeStruct->typelem);
prodesc->result_in_len = typeStruct->typlen;
prodesc->result_in_elem = typeStruct->typelem;
/************************************************************
* Get the required information for output conversion
@@ -721,7 +719,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
retval = (Datum) (*fmgr_faddr(&prodesc->result_in_func))
(pltcl_safe_interp->result,
prodesc->result_in_elem,
prodesc->result_in_len);
-1);
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
return retval;
@@ -1140,10 +1138,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
modvalues[attnum - 1] = (Datum) (*fmgr_faddr(&finfo))
(ret_values[i++],
typelem,
(!VARLENA_FIXED_SIZE(tupdesc->attrs[attnum - 1]))
? tupdesc->attrs[attnum - 1]->attlen
: tupdesc->attrs[attnum - 1]->atttypmod
);
tupdesc->attrs[attnum - 1]->atttypmod);
}