postgresql/contrib/postgres_fdw
Andrew Gierth bf2d0462cd 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 14:43:51 +01:00
..
expected Spell "partitionwise" consistently. 2018-08-09 10:43:18 +03:00
sql Spell "partitionwise" consistently. 2018-08-09 10:43:18 +03:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c Improve style guideline compliance of assorted error-report messages. 2018-03-22 17:33:10 -04:00
deparse.c Fix WITH CHECK OPTION on views referencing postgres_fdw tables. 2018-07-08 16:53:36 -07:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
option.c Improve style guideline compliance of assorted error-report messages. 2018-03-22 17:33:10 -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 14:43:51 +01:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h Fix WITH CHECK OPTION on views referencing postgres_fdw tables. 2018-07-08 16:53:36 -07:00
shippable.c Update copyright for 2018 2018-01-02 23:30:12 -05:00