mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Intercept temp table lookups further up to map temp names.
This commit is contained in:
13
src/backend/utils/cache/syscache.c
vendored
13
src/backend/utils/cache/syscache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.34 1999/08/09 03:13:30 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.35 1999/09/04 22:00:30 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@ -35,6 +35,7 @@
|
||||
#include "catalog/pg_shadow.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "utils/catcache.h"
|
||||
#include "utils/temprel.h"
|
||||
|
||||
extern bool AMI_OVERRIDE; /* XXX style */
|
||||
|
||||
@ -487,6 +488,16 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
|
||||
cacheId);
|
||||
}
|
||||
|
||||
/* temp table name remapping */
|
||||
if (cacheId == RELNAME)
|
||||
{
|
||||
char *nontemp_relname;
|
||||
|
||||
if ((nontemp_relname =
|
||||
get_temp_rel_by_name(DatumGetPointer(key1))) != NULL)
|
||||
key1 = PointerGetDatum(nontemp_relname);
|
||||
}
|
||||
|
||||
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
|
||||
if (!HeapTupleIsValid(tp))
|
||||
{
|
||||
|
Reference in New Issue
Block a user