Skip to content

Conversation

@zilder
Copy link
Member

@zilder zilder commented Jul 17, 2025

Fixes #8367

add_compression_policy() and add_columnstore_policy() share the same C-function, but their arguments have different names. We have to respect that in the error messages we show users. In this patch we introduce different error messages depending on which SQL function/procedure was invoked.

@zilder zilder force-pushed the zilder/add-compression-policy-args branch 2 times, most recently from 6928b27 to 91d17c3 Compare July 17, 2025 16:48
Comment on lines 380 to 388
/*
* `policy_compression_add` is used by both `add_compression_policy()` and
* `add_columnstore_policy()`; but thier arguments names differ. We need to
* respect that in the error messages.
*/
if (OidIsValid(fn_oid) && strcmp(get_func_name(fn_oid), "add_columnstore_policy") == 0)
{
is_columnstore_policy = true;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I could have added two different C functions for policy_compression_add and add_compression_policy to differentiate between them but I thought it would be excessive. Instead I check which SQL function invoked the call.

`add_compression_policy()` and `add_columnstore_policy()` share the same
C-function, but their arguments have different names. We have to respect
that in the error messages we show users. In this patch we introduce
different error messages depending on which SQL function/procedure was
invoked.
@zilder zilder force-pushed the zilder/add-compression-policy-args branch from 91d17c3 to a534b67 Compare July 18, 2025 08:26
@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.35%. Comparing base (423b8ba) to head (a534b67).
⚠️ Report is 385 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/bgw_policy/compression_api.c 55.55% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8394      +/-   ##
==========================================
+ Coverage   82.28%   82.35%   +0.06%     
==========================================
  Files         246      246              
  Lines       46120    46098      -22     
  Branches    11653    11652       -1     
==========================================
+ Hits        37949    37962      +13     
- Misses       3488     3504      +16     
+ Partials     4683     4632      -51     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fabriziomello
Copy link
Member

@zilder are u planning to continue and finish this PR?

@github-actions
Copy link

This pull request has been automatically marked as stale due to lack of activity. This pull request will be closed in 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Wrong parameter name in error message

2 participants