diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-01 18:56:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-01 18:56:19 +0000 |
commit | 6c412f0605afeb809014553ff7ad28cf9ed5526b (patch) | |
tree | 5540a678c19dcfa1a7023e0f59a970fe2a9a79ee /src/backend/executor/spi.c | |
parent | ae793ff63cb9167ea6d0f24ca018ffabad157ece (diff) | |
download | postgresql-6c412f0605afeb809014553ff7ad28cf9ed5526b.tar.gz postgresql-6c412f0605afeb809014553ff7ad28cf9ed5526b.zip |
Change CREATE TYPE to require datatype output and send functions to have
only one argument. (Per recent discussion, the option to accept multiple
arguments is pretty useless for user-defined types, and would be a likely
source of security holes if it was used.) Simplify call sites of
output/send functions to not bother passing more than one argument.
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r-- | src/backend/executor/spi.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index c72201c6e6a..0a9bede0e04 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.137 2005/03/29 02:53:53 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.138 2005/05/01 18:56:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -632,9 +632,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) result; bool isnull; Oid typoid, - foutoid, - typioparam; - int32 typmod; + foutoid; bool typisvarlena; SPI_result = 0; @@ -651,17 +649,11 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) return NULL; if (fnumber > 0) - { typoid = tupdesc->attrs[fnumber - 1]->atttypid; - typmod = tupdesc->attrs[fnumber - 1]->atttypmod; - } else - { typoid = (SystemAttributeDefinition(fnumber, true))->atttypid; - typmod = -1; - } - getTypeOutputInfo(typoid, &foutoid, &typioparam, &typisvarlena); + getTypeOutputInfo(typoid, &foutoid, &typisvarlena); /* * If we have a toasted datum, forcibly detoast it here to avoid @@ -672,10 +664,8 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) else val = origval; - result = OidFunctionCall3(foutoid, - val, - ObjectIdGetDatum(typioparam), - Int32GetDatum(typmod)); + result = OidFunctionCall1(foutoid, + val); /* Clean up detoasted copy, if any */ if (val != origval) |