8000 Bugfix. Recursing into subquery we must use subroot instead of root to · postgrespro/aqo@304b443 · GitHub
[go: up one dir, main page]

Skip to content

Commit 304b443

Browse files
committed
Bugfix. Recursing into subquery we must use subroot instead of root to
translate relids in this subtree.
1 parent cc0f407 commit 304b443

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cardinality_hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ aqo_set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
298298
List *inner_selectivities;
299299
List *outer_selectivities;
300300
List *current_selectivities = NULL;
301-
int fss = 0;
301+
int fss = 0;
302302

303303
if (IsQueryDisabled())
304304
/* Fast path */

path_utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
314314
selectivities);
315315
break;
316316
case T_SubqueryScanPath:
317-
return get_path_clauses(((SubqueryScanPath *) path)->subpath, root,
317+
/* Recursing into Subquery we must use subroot */
318+
Assert(path->parent->subroot != NULL);
319+
return get_path_clauses(((SubqueryScanPath *) path)->subpath,
320+
path->parent->subroot,
318321
selectivities);
319322
break;
320323
case T_ModifyTablePath:

0 commit comments

Comments
 (0)
0