Coerce GRAPH_TABLE pattern WHERE clauses to boolean transformGraphElementPattern() and transformGraphPattern() ran their WHERE clauses through transformExpr() without ever applying coerce_to_boolean(), so a WHERE clause of any type was accepted and its bare datum was used as the qual, which resulted in wrong results without a diagnostic. Route both sites through transformWhereClause(), like every other WHERE clause, and add regression tests for the element-level and pattern-level cases.
Author: Ewan Young <[email protected]> Reviewed-by: Chao Li <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/CAON2xHNZUS8ZwzVEJFeRirsC_-7EJvdbwABSzdGaJ_DF9DvHoQ%40mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/792094a5ce89f9953d913c835e4530e56b63026a Modified Files -------------- src/backend/parser/parse_graphtable.c | 7 +++++-- src/test/regress/expected/graph_table.out | 4 ++++ src/test/regress/sql/graph_table.sql | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)
