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

Commitea99865

Browse files
committed
[PGPRO-7183] bring in line stable 13, 14, 15
Cherry-pick commit:62b3945restore_selectivities: avoid links to restrictinfo selectivity field: it can be freed or changed externally
1 parent4a278c1 commitea99865

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

‎postprocessing.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ restore_selectivities(List *clauselist, List *relidslist, JoinType join_type,
178178
intnargs;
179179
int*args_hash;
180180
int*eclass_hash;
181-
double*cur_sel;
182181
intcur_hash;
183182
intcur_relid;
184183

@@ -193,30 +192,29 @@ restore_selectivities(List *clauselist, List *relidslist, JoinType join_type,
193192
foreach(l,clauselist)
194193
{
195194
RestrictInfo*rinfo= (RestrictInfo*)lfirst(l);
195+
Selectivity*cur_sel=NULL;
196196

197-
cur_sel=NULL;
198197
if (parametrized_sel)
199198
{
200199
cur_hash=get_clause_hash(rinfo->clause,nargs,
201200
args_hash,eclass_hash);
202201
cur_sel=selectivity_cache_find_global_relid(cur_hash,cur_relid);
203-
if (cur_sel==NULL)
204-
{
205-
if (join_type==JOIN_INNER)
206-
cur_sel=&rinfo->norm_selec;
207-
else
208-
cur_sel=&rinfo->outer_selec;
209-
}
210202
}
211-
elseif (join_type==JOIN_INNER)
212-
cur_sel=&rinfo->norm_selec;
213-
else
214-
cur_sel=&rinfo->outer_selec;
215203

216-
if (*cur_sel<0)
217-
*cur_sel=0;
204+
if (cur_sel==NULL)
205+
{
206+
cur_sel=palloc(sizeof(double));
207+
208+
if (join_type==JOIN_INNER)
209+
*cur_sel=rinfo->norm_selec;
210+
else
211+
*cur_sel=rinfo->outer_selec;
212+
213+
if (*cur_sel<0)
214+
*cur_sel=0;
215+
}
218216

219-
Assert(cur_sel>0);
217+
Assert(*cur_sel >=0);
220218

221219
lst=lappend(lst,cur_sel);
222220
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp