Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb36c0f

Browse files
committed
In RelationNameGetRelation(), replace temp table name by
real name before doing lookup. We only want to index temp tables by theirreal names in the relcache, to ensure there's not more than one relcacheentry for them.
1 parent15dd167 commitcb36c0f

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.69 1999/09/0418:42:13 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.70 1999/09/0421:47:23 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -56,6 +56,7 @@
5656
#include"utils/builtins.h"
5757
#include"utils/catcache.h"
5858
#include"utils/relcache.h"
59+
#include"utils/temprel.h"
5960

6061

6162
staticvoidRelationFlushRelation(Relation*relationPtr,
@@ -1182,6 +1183,7 @@ RelationIdGetRelation(Oid relationId)
11821183
Relation
11831184
RelationNameGetRelation(char*relationName)
11841185
{
1186+
char*temprelname;
11851187
Relationrd;
11861188
RelationBuildDescInfobuildinfo;
11871189

@@ -1192,6 +1194,15 @@ RelationNameGetRelation(char *relationName)
11921194
IncrHeapAccessStat(local_RelationNameGetRelation);
11931195
IncrHeapAccessStat(global_RelationNameGetRelation);
11941196

1197+
/* ----------------
1198+
*if caller is looking for a temp relation, substitute its real name;
1199+
*we only index temp rels by their real names.
1200+
* ----------------
1201+
*/
1202+
temprelname=get_temp_rel_by_name(relationName);
1203+
if (temprelname)
1204+
relationName=temprelname;
1205+
11951206
/* ----------------
11961207
*first try and get a reldesc from the cache
11971208
* ----------------
@@ -1212,26 +1223,6 @@ RelationNameGetRelation(char *relationName)
12121223
returnrd;
12131224
}
12141225

1215-
/* ----------------
1216-
*old "getreldesc" interface.
1217-
* ----------------
1218-
*/
1219-
#ifdefNOT_USED
1220-
Relation
1221-
getreldesc(char*relationName)
1222-
{
1223-
/* ----------------
1224-
*increment access statistics
1225-
* ----------------
1226-
*/
1227-
IncrHeapAccessStat(local_getreldesc);
1228-
IncrHeapAccessStat(global_getreldesc);
1229-
1230-
returnRelationNameGetRelation(relationName);
1231-
}
1232-
1233-
#endif
1234-
12351226
/* ----------------------------------------------------------------
12361227
*cache invalidation support routines
12371228
* ----------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp