-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PG17 compatibility: Fix Test Failure in local_dist_join_mixed #7731
base: naisila/pg17_support
Are you sure you want to change the base?
Conversation
(cherry picked from commit ae3ed7d)
(cherry picked from commit 76f60a7)
(cherry picked from commit df9c7b4)
In PG17, the outer loop in acquire_sample_rows() changed from while (BlockSampler_HasMore(&bs)) to while (table_scan_analyze_next_block(scan, stream)) Relevant PG commit: 041b96802efa33d2bc9456f2ad946976b92b5ae1 postgres/postgres@041b968 It is expected that the scan_analyze_next_block function will check if there are any blocks left. So we add that check in columnar_scan_analyze_next_block (cherry picked from commit 7eb0ad5)
PG 17 added support for DEFAULT in ALTER TABLE .. SET ACCESS METHOD Relevant PG commit: d61a6cad6418f643a5773352038d0dfe5d3535b8 postgres/postgres@d61a6ca In that case, name in AlterTableCmd would be null. Add a null check here to avoid crash. (cherry picked from commit 71b9974)
…tests Fix pg15 pg16 multi_mx_create_table multi_schema_support Relevant PG commit: postgres/postgres@f696c0c f696c0cd5f299f1b51e214efc55a22a782cc175d (cherry picked from commit 17a2ed0)
Relevant PG commit: f69319f2f1fb16eda4b535bcccec90dff3a6795e postgres/postgres@f69319f (cherry picked from commit 6c12b10)
This PR addresses a regression test failure in the multi-mx feature of Citus with the new PostgreSQL 17 version. The regression was identified during the execution of multi-node tests, specifically targeting compatibility issues introduced with PostgreSQL 17. --------- Co-authored-by: Mehmet YILMAZ <[email protected]> (cherry picked from commit 70cf729)
This reverts commit e4040dd. Reverting for now as this commit is fixing more than one thing at once at multi_extension.out file Its a harmless revert for testing purposes
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## naisila/pg17_support #7731 +/- ##
========================================================
- Coverage 89.61% 89.60% -0.01%
========================================================
Files 274 274
Lines 59689 59689
Branches 7446 7446
========================================================
- Hits 53490 53486 -4
- Misses 4069 4072 +3
- Partials 2130 2131 +1 |
@@ -1266,7 +1271,7 @@ DEBUG: generating subplan XXX_8 for subquery SELECT id FROM local_dist_join_mix | |||
DEBUG: Wrapping relation "local" to a subquery | |||
DEBUG: generating subplan XXX_9 for subquery SELECT id FROM local_dist_join_mixed.local WHERE true | |||
DEBUG: Wrapping relation "local" to a subquery | |||
DEBUG: generating subplan XXX_10 for subquery SELECT id FROM local_dist_join_mixed.local WHERE (id IS NOT NULL) | |||
DEBUG: generating subplan XXX_10 for subquery SELECT id FROM local_dist_join_mixed.local WHERE true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am reluctant to merge a whole new test output for just a single line change. Let's think a bit more how we can fix this.
46dc966
to
6d036b0
Compare
Here we can simply remove the redundant filter because it wasn't the original intention of this test. SELECT
foo1.id
FROM
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo9,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo8,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo7,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo6,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo5,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo4,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo3,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo2,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo10,
(SELECT local.id, local.title FROM local, distributed WHERE local.id = distributed.id ) as foo1
WHERE
foo1.id = foo9.id AND
foo1.id = foo8.id AND
foo1.id = foo7.id AND
foo1.id = foo6.id AND
foo1.id = foo5.id AND
foo1.id = foo4.id AND
foo1.id = foo3.id AND
foo1.id = foo2.id AND
foo1.id = foo10.id AND
- foo1.id = foo1.id
ORDER BY 1; |
e108bb8
to
c396ce6
Compare
PostgreSQL 16 adds an extra condition (id IS NOT NULL) to the subquery. This condition is likely used to ensure that no null values are processed in the subquery. Instead of using the condition id IS NOT NULL, PostgreSQL 17 generates the subplan with a trivial condition (WHERE true), indicating that it does not need to explicitly check for non-null values.
PostgreSQL 17 likely includes optimizations to handle null checks more efficiently. The WHERE (id IS NOT NULL) condition that was present in PostgreSQL 16 may now be considered redundant by the planner, as it is implicitly handled by the query execution engine.
postgres/postgres@b262ad44