pgsql: Fix LATERAL join test in test memoize.sql

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix LATERAL join test in test memoize.sql
Date: 2023-01-23 23:29:46
Message-ID: E1pK6G1-0058ss-O1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix LATERAL join test in test memoize.sql

The test in question was meant to be testing Memoize to ensure it worked
correctly when the inner side of the join contained lateral vars, however,
nothing in the lateral subquery stopped it from being pulled up into the
main query, so the planner did that, and that meant no more lateral vars.

Here we add a simple ORDER BY to stop the planner from being able to
pullup the lateral subquery.

Author: Richard Guo
Discussion: https://postgr.es/m/CAMbWs4_LHJaN4L-tXpKMiPFnsCJWU1P8Xh59o0W7AA6UN99=cQ@mail.gmail.com
Backpatch-through: 14, where Memoize was added.

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bcec08907e9357425ec0b3ea9ce03fd41fa6b8de

Modified Files
--------------
src/test/regress/expected/memoize.out | 8 +++++---
src/test/regress/sql/memoize.sql | 6 ++++--
2 files changed, 9 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-01-23 23:30:23 pgsql: Fix LATERAL join test in test memoize.sql
Previous Message Peter Eisentraut 2023-01-23 21:08:59 pgsql: Fix XLogPageRead() comment