Fix empty FOREIGN_JOIN sublist validation

FOREIGN_JOIN target sublists must contain at least two relation
identifiers.  However, the parser checked only for sublists with
exactly one identifier, so FOREIGN_JOIN(()) was accepted.

Reject sublists with fewer than two relation identifiers, and add
regression coverage.

Author: Chao Li <[email protected]>
Discussion: http://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8c9c2e5c09aeda713640ccb26bfca0fdccc310d5

Modified Files
--------------
contrib/pg_plan_advice/expected/syntax.out | 3 +++
contrib/pg_plan_advice/pgpa_parser.y       | 2 +-
contrib/pg_plan_advice/sql/syntax.sql      | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)

Reply via email to