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

Commitb396df8

Browse files
committed
Don't remove the 'alias' field from flattened rangetable entries;
there are some corner cases where this is needed by ruleutils.c forproper display of variables during EXPLAIN.
1 parentf02a82b commitb396df8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/optimizer/plan/setrefs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.133 2007/02/23 21:59:44 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.134 2007/04/06 22:57:20 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -156,7 +156,8 @@ set_plan_references(PlannerGlobal *glob, Plan *plan, List *rtable)
156156
/*
157157
* In the flat rangetable, we zero out substructure pointers that are
158158
* not needed by the executor; this reduces the storage space and
159-
* copying cost for cached plans.
159+
* copying cost for cached plans. We keep only the alias and eref
160+
* Alias fields, which are needed by EXPLAIN.
160161
*/
161162
foreach(lc,rtable)
162163
{
@@ -167,14 +168,13 @@ set_plan_references(PlannerGlobal *glob, Plan *plan, List *rtable)
167168
newrte= (RangeTblEntry*)palloc(sizeof(RangeTblEntry));
168169
memcpy(newrte,rte,sizeof(RangeTblEntry));
169170

170-
/* zap unneeded sub-structure(we keep only the eref Alias)*/
171+
/* zap unneeded sub-structure */
171172
newrte->subquery=NULL;
172173
newrte->funcexpr=NULL;
173174
newrte->funccoltypes=NIL;
174175
newrte->funccoltypmods=NIL;
175176
newrte->values_lists=NIL;
176177
newrte->joinaliasvars=NIL;
177-
newrte->alias=NULL;
178178

179179
glob->finalrtable=lappend(glob->finalrtable,newrte);
180180
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp