diff options
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/nodeGroup.c | 14 | ||||
-rw-r--r-- | src/backend/executor/nodeUnique.c | 19 | ||||
-rw-r--r-- | src/backend/executor/spi.c | 12 |
3 files changed, 23 insertions, 22 deletions
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c index 54cf97ca3e1..0f86f73a2b1 100644 --- a/src/backend/executor/nodeGroup.c +++ b/src/backend/executor/nodeGroup.c @@ -13,7 +13,7 @@ * columns. (ie. tuples from the same group are consecutive) * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.23 1998/11/27 19:52:01 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.24 1999/01/24 05:40:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -364,12 +364,14 @@ sameGroup(HeapTuple oldtuple, *val2; int i; AttrNumber att; - Oid typoutput; + Oid typoutput, + typelem; for (i = 0; i < numCols; i++) { att = grpColIdx[i]; - typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid); + getTypeOutAndElem((Oid) tupdesc->attrs[att - 1]->atttypid, + &typoutput, &typelem); attr1 = heap_getattr(oldtuple, att, @@ -386,11 +388,9 @@ sameGroup(HeapTuple oldtuple, if (isNull1) /* both are null, they are equal */ continue; - val1 = fmgr(typoutput, attr1, - gettypelem(tupdesc->attrs[att - 1]->atttypid), + val1 = fmgr(typoutput, attr1, typelem, tupdesc->attrs[att - 1]->atttypmod); - val2 = fmgr(typoutput, attr2, - gettypelem(tupdesc->attrs[att - 1]->atttypid), + val2 = fmgr(typoutput, attr2, typelem, tupdesc->attrs[att - 1]->atttypmod); /* diff --git a/src/backend/executor/nodeUnique.c b/src/backend/executor/nodeUnique.c index c04c44fa0d1..999362ab69d 100644 --- a/src/backend/executor/nodeUnique.c +++ b/src/backend/executor/nodeUnique.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.18 1998/11/27 19:52:03 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.19 1999/01/24 05:40:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,7 +31,7 @@ #include "executor/nodeUnique.h" #include "optimizer/clauses.h" #include "access/heapam.h" -#include "access/printtup.h" /* for typtoout() */ +#include "access/printtup.h" /* for getTypeOutAndElem() */ #include "utils/builtins.h" /* for namecpy() */ /* ---------------------------------------------------------------- @@ -117,7 +117,8 @@ ExecUnique(Unique *node) char *uniqueAttr; AttrNumber uniqueAttrNum; TupleDesc tupDesc; - Oid typoutput; + Oid typoutput, + typelem; /* ---------------- * get information from the node @@ -132,12 +133,14 @@ ExecUnique(Unique *node) if (uniqueAttr) { tupDesc = ExecGetResultType(uniquestate); - typoutput = typtoout((Oid) tupDesc->attrs[uniqueAttrNum - 1]->atttypid); + getTypeOutAndElem((Oid) tupDesc->attrs[uniqueAttrNum - 1]->atttypid, + &typoutput, &typelem); } else { /* keep compiler quiet */ tupDesc = NULL; - typoutput = 0; + typoutput = InvalidOid; + typelem = InvalidOid; } /* ---------------- @@ -196,11 +199,9 @@ ExecUnique(Unique *node) { if (isNull1) /* both are null, they are equal */ continue; - val1 = fmgr(typoutput, attr1, - gettypelem(tupDesc->attrs[uniqueAttrNum - 1]->atttypid), + val1 = fmgr(typoutput, attr1, typelem, tupDesc->attrs[uniqueAttrNum - 1]->atttypmod); - val2 = fmgr(typoutput, attr2, - gettypelem(tupDesc->attrs[uniqueAttrNum - 1]->atttypid), + val2 = fmgr(typoutput, attr2, typelem, tupDesc->attrs[uniqueAttrNum - 1]->atttypmod); /* diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 125a36241ad..5620cf78916 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -3,7 +3,7 @@ * spi.c-- * Server Programming Interface * - * $Id: spi.c,v 1.29 1998/12/14 05:18:51 scrappy Exp $ + * $Id: spi.c,v 1.30 1999/01/24 05:40:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -409,7 +409,8 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) { Datum val; bool isnull; - Oid foutoid; + Oid foutoid, + typelem; SPI_result = 0; if (tuple->t_data->t_natts < fnumber || fnumber <= 0) @@ -421,15 +422,14 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) val = heap_getattr(tuple, fnumber, tupdesc, &isnull); if (isnull) return NULL; - foutoid = typtoout((Oid) tupdesc->attrs[fnumber - 1]->atttypid); - if (!OidIsValid(foutoid)) + if (! getTypeOutAndElem((Oid) tupdesc->attrs[fnumber - 1]->atttypid, + &foutoid, &typelem)) { SPI_result = SPI_ERROR_NOOUTFUNC; return NULL; } - return (fmgr(foutoid, val, - gettypelem(tupdesc->attrs[fnumber - 1]->atttypid), + return (fmgr(foutoid, val, typelem, tupdesc->attrs[fnumber - 1]->atttypmod)); } |