Skip to content
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

Fix handling of oldtuple to match PG17 upstream #7340

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

kpan2034
Copy link
Contributor

@kpan2034 kpan2034 commented Oct 11, 2024

A previous commit I made added support for MERGE ... RETURNING ....
While working on the coverity fix, I realized that this code handling oldtuple was not added; that's what this fixes.

Disable-check: force-changelog-file

@kpan2034 kpan2034 added the pg17 label Oct 11, 2024
@kpan2034 kpan2034 self-assigned this Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.58%. Comparing base (59f50f2) to head (09ff3e3).
Report is 566 commits behind head on main.

Files with missing lines Patch % Lines
src/import/ht_hypertable_modify.c 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7340      +/-   ##
==========================================
+ Coverage   80.06%   82.58%   +2.51%     
==========================================
  Files         190      229      +39     
  Lines       37181    42728    +5547     
  Branches     9450    10734    +1284     
==========================================
+ Hits        29770    35285    +5515     
- Misses       2997     3164     +167     
+ Partials     4414     4279     -135     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +462 to +468
#if PG17_GE
if (oldtuple != NULL)
ExecForceStoreHeapTuple(oldtuple, resultRelInfo->ri_oldTupleSlot,
false);
else
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code in upstream was added by this commit postgres/postgres@5f2e179 so I think there are more things to import, no?

Also what this new code is fixing cause seems our regression tests are not reaching it per codecov?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having a close look on it and actually we need to introduce support for MERGE ... WHEN NOT MATCHED BY SOURCE THEN ... for hypertables instead and it will require more work on ht_hypertable_modify.c

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is mostly to silence coverity

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the coverity was already silenced, no? I mean it will no hurt to merge this tiny PR but it still requires more work to sync it with upstream. I'm working on another PR to make this new merge clause work for hypertables because I want to use it on the new cagg refresh code using merge statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A previous commit I made added support for MERGE ... RETURNING ....
While working on the coverity fix, I realized that this code handling oldtuple was not added; that's what this fixes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kpan2034 would be good then mention it on the commit message and in the PR description to make clear the change you're proposing.

@kpan2034 kpan2034 enabled auto-merge (squash) October 21, 2024 19:08
@kpan2034 kpan2034 merged commit 650d331 into timescale:main Oct 24, 2024
46 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants