agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Coerce GRAPH_TABLE pattern WHERE clauses to boolean
2+ messages / 1 participants
[nested] [flat]

* pgsql: Coerce GRAPH_TABLE pattern WHERE clauses to boolean
@ 2026-09-02 19:14 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-09-02 19:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <kdbase.hack@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAON2xHNZUS8ZwzVEJFeRirsC_-7EJvdbwABSzdGaJ_DF9DvHoQ%40mai...

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Coerce GRAPH_TABLE pattern WHERE clauses to boolean
@ 2026-09-02 19:14 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-09-02 19:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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 <kdbase.hack@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAON2xHNZUS8ZwzVEJFeRirsC_-7EJvdbwABSzdGaJ_DF9DvHoQ%40mai...

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1c8c790ec104bbef338eb52a9dc17030cee7c82e

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-09-02 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02 19:14 pgsql: Coerce GRAPH_TABLE pattern WHERE clauses to boolean Peter Eisentraut <peter@eisentraut.org>
2026-09-02 19:14 pgsql: Coerce GRAPH_TABLE pattern WHERE clauses to boolean Peter Eisentraut <peter@eisentraut.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox