* Helper routine that frees keys stored in the keys array. */
| 1975 | * Helper routine that frees keys stored in the keys array. |
| 1976 | */ |
| 1977 | static void |
| 1978 | CatCacheFreeKeys(TupleDesc tupdesc, int nkeys, int *attnos, Datum *keys) |
| 1979 | { |
| 1980 | int i; |
| 1981 | |
| 1982 | for (i = 0; i < nkeys; i++) |
| 1983 | { |
| 1984 | int attnum = attnos[i]; |
| 1985 | Form_pg_attribute att; |
| 1986 | |
| 1987 | /* system attribute are not supported in caches */ |
| 1988 | Assert(attnum > 0); |
| 1989 | |
| 1990 | att = TupleDescAttr(tupdesc, attnum - 1); |
| 1991 | |
| 1992 | if (!att->attbyval) |
| 1993 | pfree(DatumGetPointer(keys[i])); |
| 1994 | } |
| 1995 | } |
| 1996 | |
| 1997 | /* |
| 1998 | * Helper routine that copies the keys in the srckeys array into the dstkeys |
no test coverage detected