|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/optimizer/plan/initsplan.c,v 1.97 2004/01/05 05:07:35 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/optimizer/plan/initsplan.c,v 1.98 2004/02/27 21:42:00 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -756,11 +756,16 @@ process_implied_equality(Query *root,
|
756 | 756 | errmsg("equality operator for types %s and %s should be merge-joinable, but isn't",
|
757 | 757 | format_type_be(ltype),format_type_be(rtype))));
|
758 | 758 |
|
| 759 | +/* |
| 760 | + * Now we can build the new clause. Copy to ensure it shares no |
| 761 | + * substructure with original (this is necessary in case there are |
| 762 | + * subselects in there...) |
| 763 | + */ |
759 | 764 | clause=make_opclause(oprid(eq_operator),/* opno */
|
760 | 765 | BOOLOID,/* opresulttype */
|
761 | 766 | false,/* opretset */
|
762 |
| - (Expr*)item1, |
763 |
| - (Expr*)item2); |
| 767 | + (Expr*)copyObject(item1), |
| 768 | + (Expr*)copyObject(item2)); |
764 | 769 |
|
765 | 770 | ReleaseSysCache(eq_operator);
|
766 | 771 |
|
|