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

Commitbf2d046

Browse files
committed
postgres_fdw: don't push ORDER BY with no vars (bug #15352)
Commitaa09cd2 changed a condition in find_em_expr_for_rel frombeing a bms_equal comparison of relids to bms_is_subset, in order tosupport order by clauses on foreign joins. But this also allowsthrough the degenerate case of expressions with no Vars at all (andhence empty relids), including integer constants which will be parsedunexpectedly on the remote (viz. "ERROR: ORDER BY position 0 is not inselect list" as in the bug report).Repair by adding an additional !bms_is_empty test.Backpatch through to 9.6 where the aforementioned change was made.Per bug #15352 from Maksym Boguk; analysis and patch by me.Discussion:https://postgr.es/m/153518420278.1478.14875560810251994661@wrigleys.postgresql.org
1 parentbfea331 commitbf2d046

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5793,7 +5793,8 @@ find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel)
57935793
{
57945794
EquivalenceMember*em=lfirst(lc_em);
57955795

5796-
if (bms_is_subset(em->em_relids,rel->relids))
5796+
if (bms_is_subset(em->em_relids,rel->relids)&&
5797+
!bms_is_empty(em->em_relids))
57975798
{
57985799
/*
57995800
* If there is more than one equivalence member whose Vars are

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp