|
1 | 1 | /**********************************************************************
|
2 | 2 | * plperl.c - perl as a procedural language for PostgreSQL
|
3 | 3 | *
|
4 |
| - * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123 2006/11/21 16:59:02 adunstan Exp $ |
| 4 | + * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.124 2007/01/27 01:55:57 adunstan Exp $ |
5 | 5 | *
|
6 | 6 | **********************************************************************/
|
7 | 7 |
|
@@ -2128,23 +2128,23 @@ plperl_spi_prepare(char *query, int argc, SV **argv)
|
2128 | 2128 | PG_TRY();
|
2129 | 2129 | {
|
2130 | 2130 | /************************************************************
|
2131 |
| - * Lookup the argument types by name in the system cache |
2132 |
| - * and remember the required information for input conversion |
| 2131 | + * Resolve argument type names and then look them up by oid |
| 2132 | + * in the system cache, and remember the required information |
| 2133 | + * for input conversion. |
2133 | 2134 | ************************************************************/
|
2134 | 2135 | for (i = 0; i < argc; i++)
|
2135 | 2136 | {
|
2136 |
| - List *names; |
2137 |
| - HeapTuple typeTup; |
2138 |
| - |
2139 |
| - /* Parse possibly-qualified type name and look it up in pg_type */ |
2140 |
| - names = stringToQualifiedNameList(SvPV(argv[i], PL_na), |
2141 |
| - "plperl_spi_prepare"); |
2142 |
| - typeTup = typenameType(NULL, makeTypeNameFromNameList(names)); |
2143 |
| - qdesc->argtypes[i] = HeapTupleGetOid(typeTup); |
2144 |
| - perm_fmgr_info(((Form_pg_type) GETSTRUCT(typeTup))->typinput, |
| 2137 | + Oid typId, typInput, typIOParam; |
| 2138 | + int32 typmod; |
| 2139 | + |
| 2140 | + parseTypeString(SvPV(argv[i], PL_na), &typId, &typmod); |
| 2141 | + |
| 2142 | + getTypeInputInfo(typId, &typInput, &typIOParam); |
| 2143 | + |
| 2144 | + qdesc->argtypes[i] = typId; |
| 2145 | + perm_fmgr_info((Form_pg_type) typInput, |
2145 | 2146 | &(qdesc->arginfuncs[i]));
|
2146 |
| - qdesc->argtypioparams[i] = getTypeIOParam(typeTup); |
2147 |
| - ReleaseSysCache(typeTup); |
| 2147 | + qdesc->argtypioparams[i] = typIOParam; |
2148 | 2148 | }
|
2149 | 2149 |
|
2150 | 2150 | /************************************************************
|
|
0 commit comments