postgres/contrib/postgres_fdw
Andrew Gierth 64eed263ac postgres_fdw: don't push ORDER BY with no vars (bug #15352)
Commit aa09cd242 changed a condition in find_em_expr_for_rel from
being a bms_equal comparison of relids to bms_is_subset, in order to
support order by clauses on foreign joins. But this also allows
through the degenerate case of expressions with no Vars at all (and
hence empty relids), including integer constants which will be parsed
unexpectedly on the remote (viz. "ERROR: ORDER BY position 0 is not in
select 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
2018-08-28 15:04:24 +01:00
..
expected Fix hashjoin costing mistake introduced with inner_unique optimization. 2018-07-14 11:59:12 -04:00
sql Fix test case for 'outer pathkeys do not match mergeclauses' fix. 2018-01-30 14:47:02 -05:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c Re-establish postgres_fdw connections after server or user mapping changes. 2017-07-21 12:51:38 -04:00
deparse.c Fix postgres_fdw to cope with duplicate GROUP BY entries. 2018-01-12 16:52:49 -05:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
option.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c postgres_fdw: don't push ORDER BY with no vars (bug #15352) 2018-08-28 15:04:24 +01:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h postgres_fdw: Move function prototype to correct section. 2017-06-22 12:44:53 -04:00
shippable.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00