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

Commitd40ade2

Browse files
committed
Bugfix. Copy of clauses, have got by aqo_get_clauses() has a specific structure
and shouldn't be touched by any postgres machinery except node hash generator.
1 parentad4dd06 commitd40ade2

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎cardinality_hooks.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,17 @@ aqo_get_parameterized_baserel_size(PlannerInfo *root,
234234
{
235235
MemoryContextold_ctx_m;
236236

237+
selectivities=list_concat(
238+
get_selectivities(root,param_clauses,rel->relid,
239+
JOIN_INNER,NULL),
240+
get_selectivities(root,rel->baserestrictinfo,
241+
rel->relid,
242+
JOIN_INNER,NULL));
243+
244+
/* Make specific copy of clauses with mutated subplans */
237245
allclauses=list_concat(aqo_get_clauses(root,param_clauses),
238246
aqo_get_clauses(root,rel->baserestrictinfo));
239-
selectivities=get_selectivities(root,allclauses,rel->relid,
240-
JOIN_INNER,NULL);
247+
241248
rte=planner_rt_fetch(rel->relid,root);
242249
get_eclasses(allclauses,&nargs,&args_hash,&eclass_hash);
243250

‎path_utils.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,16 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
430430
caseT_ForeignPath:
431431
/* The same as in the default case */
432432
default:
433-
cur=list_concat(aqo_get_clauses(root,
434-
path->parent->baserestrictinfo),
433+
cur=list_concat(list_copy(path->parent->baserestrictinfo),
435434
path->param_info ?
436-
aqo_get_clauses(root,
437-
path->param_info->ppi_clauses) :
438-
NIL);
435+
path->param_info->ppi_clauses :NIL);
439436
if (path->param_info)
440437
cur_sel=get_selectivities(root,cur,path->parent->relid,
441438
JOIN_INNER,NULL);
442439
else
443440
cur_sel=get_selectivities(root,cur,0,JOIN_INNER,NULL);
444441
*selectivities=cur_sel;
442+
cur=aqo_get_clauses(root,cur);
445443
returncur;
446444
break;
447445
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp