mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.50 1999/12/09 15:56:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.51 2000/01/15 22:43:24 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -669,21 +669,21 @@ array_out(ArrayType *v, Oid element_type)
|
||||
switch (typlen)
|
||||
{
|
||||
case 1:
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*p, typelem);
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*p, typelem, -1);
|
||||
break;
|
||||
case 2:
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*(int16 *) p, typelem);
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*(int16 *) p, typelem, -1);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*(int32 *) p, typelem);
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (*(int32 *) p, typelem, -1);
|
||||
break;
|
||||
}
|
||||
p += typlen;
|
||||
}
|
||||
else
|
||||
{
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (p, typelem);
|
||||
values[i] = (*fmgr_faddr(&outputproc)) (p, typelem, -1);
|
||||
if (typlen > 0)
|
||||
p += typlen;
|
||||
else
|
||||
|
Reference in New Issue
Block a user