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

Commitdd29fc2

Browse files
committed
Fix another place broken by new List implementation :-(. Per example
from goranpop@nspoint.net. I think this escaped notice because insimple cases the list is NIL on entry.
1 parent84dbd5a commitdd29fc2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎src/backend/optimizer/geqo/geqo_eval.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.71 2004/08/29 05:06:43 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.72 2004/12/15 21:13:34 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -80,12 +80,17 @@ geqo_eval(Gene *tour, int num_gene, GeqoEvalData *evaldata)
8080
oldcxt=MemoryContextSwitchTo(mycontext);
8181

8282
/*
83-
* preserve root->join_rel_list, which gimme_tree changes; without
84-
* this, it'll be pointing at recycled storage after the
85-
* MemoryContextDelete below.
83+
* gimme_tree will add entries to root->join_rel_list, which may or may
84+
* not already contain some entries. The newly added entries will be
85+
* recycled by the MemoryContextDelete below, so we must ensure that
86+
* the list is restored to its former state before exiting. With the
87+
* new List implementation, the easiest way is to make a duplicate list
88+
* that gimme_tree can modify.
8689
*/
8790
savelist=evaldata->root->join_rel_list;
8891

92+
evaldata->root->join_rel_list=list_copy(savelist);
93+
8994
/* construct the best path for the given combination of relations */
9095
joinrel=gimme_tree(tour,num_gene,evaldata);
9196

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp