1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Athough cube is a varlena type, nowhere was a detoasting of cube's value, so

fix it.  Add macroses DatumGetNDBOX, PG_GETARG_NDBOX and PG_RETURN_NDBOX.
Backpatch for 8.2 too.

Previous versions use version 0 calling conventions. And fmgr code detoast
values for user-defined functions.
This commit is contained in:
Teodor Sigaev
2007-03-07 21:21:12 +00:00
parent 626eb02198
commit 2afb01dbde
2 changed files with 166 additions and 113 deletions

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/contrib/cube/cubedata.h,v 1.8 2007/02/27 23:48:05 tgl Exp $ */
/* $PostgreSQL: pgsql/contrib/cube/cubedata.h,v 1.9 2007/03/07 21:21:12 teodor Exp $ */
#define CUBE_MAX_DIM (100)
@ -8,3 +8,7 @@ typedef struct NDBOX
unsigned int dim;
double x[1];
} NDBOX;
#define DatumGetNDBOX(x) ((NDBOX*)DatumGetPointer(x))
#define PG_GETARG_NDBOX(x) DatumGetNDBOX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) )
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x)