Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG16: Fix JOIN behaviour #6226

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/planner/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ reenable_inheritance(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntr
{
RangeTblEntry *in_rte = root->simple_rte_array[i];

if (rte_should_expand(in_rte))
if (rte_should_expand(in_rte) && root->simple_rel_array[i])
{
RelOptInfo *in_rel = root->simple_rel_array[i];
Hypertable *ht = ts_planner_get_hypertable(in_rte->relid, CACHE_FLAG_NOCREATE);
Expand Down
2 changes: 1 addition & 1 deletion test/sql/include/join_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ select * from tenk1 a join tenk1 b on
select * from tenk1 t1 left join
(tenk1 t2 join tenk1 t3 on t2.thousand = t3.unique2)
on t1.hundred = t2.hundred and t1.ten = t3.ten
where t1.unique1 = 1;
where t1.unique1 = 1 ORDER BY t1,t2,t3;

:PREFIX
select * from tenk1 t1 left join
Expand Down