|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * IDENTIFICATION
|
12 |
| - * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.116 2005/11/03 17:34:03 tgl Exp $ |
| 12 | + * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.117 2005/11/03 17:45:29 tgl Exp $ |
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
15 | 15 | */
|
@@ -382,16 +382,19 @@ set_subqueryscan_references(SubqueryScan *plan, List *rtable)
|
382 | 382 | result->initPlan);
|
383 | 383 |
|
384 | 384 | /*
|
385 |
| - *we also have to transfer the SubqueryScan's result-column names |
| 385 | + *We also have to transfer the SubqueryScan's result-column names |
386 | 386 | * into the subplan, else columns sent to client will be improperly
|
387 |
| - * labeled if this is the topmost plan level. |
| 387 | + * labeled if this is the topmost plan level. Copy the "source |
| 388 | + * column" information too. |
388 | 389 | */
|
389 | 390 | forboth(lp,plan->scan.plan.targetlist,lc,result->targetlist)
|
390 | 391 | {
|
391 | 392 | TargetEntry*ptle= (TargetEntry*)lfirst(lp);
|
392 | 393 | TargetEntry*ctle= (TargetEntry*)lfirst(lc);
|
393 | 394 |
|
394 | 395 | ctle->resname=ptle->resname;
|
| 396 | +ctle->resorigtbl=ptle->resorigtbl; |
| 397 | +ctle->resorigcol=ptle->resorigcol; |
395 | 398 | }
|
396 | 399 | }
|
397 | 400 | else
|
|