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

Commitf5d8f0b

Browse files
committed
process_implied_equality must copy the substructure of the clauses it
is generating, to avoid problems when subselects are involved. Perreport from Damon Hart.
1 parentf46a80c commitf5d8f0b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* 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 $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -756,11 +756,16 @@ process_implied_equality(Query *root,
756756
errmsg("equality operator for types %s and %s should be merge-joinable, but isn't",
757757
format_type_be(ltype),format_type_be(rtype))));
758758

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+
*/
759764
clause=make_opclause(oprid(eq_operator),/* opno */
760765
BOOLOID,/* opresulttype */
761766
false,/* opretset */
762-
(Expr*)item1,
763-
(Expr*)item2);
767+
(Expr*)copyObject(item1),
768+
(Expr*)copyObject(item2));
764769

765770
ReleaseSysCache(eq_operator);
766771

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp