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

Honor usage of OidIsValid() macro #4908

Conversation

fabriziomello
Copy link
Contributor

Postgres source code define the macro OidIsValid() to check if the Oid is valid or not (comparing against the InvalidOid type). See src/include/c.h in Postgres source three.

Changed all direct comparisons against InvalidOid for the OidIsValid call and add a coccinelle check to make sure the future changes will use it correctly.

@fabriziomello fabriziomello force-pushed the use_oidisvalid_macro_instead_of_invalidoid_comparison branch from 5f65b16 to 77986f2 Compare November 1, 2022 22:41
Copy link
Contributor

@jnidzwetzki jnidzwetzki left a comment

Choose a reason for hiding this comment

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

I have added a minor comment, the rest looks good to me.

coccinelle/oidisvalid.cocci Outdated Show resolved Hide resolved
@fabriziomello fabriziomello self-assigned this Nov 3, 2022
@fabriziomello fabriziomello added tech-debt Needs refactoring and improvement tasks related to the source code and its architecture. core Team: Core Database labels Nov 3, 2022
@fabriziomello fabriziomello force-pushed the use_oidisvalid_macro_instead_of_invalidoid_comparison branch 3 times, most recently from 06c651f to baec18c Compare November 3, 2022 14:10
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #4908 (2ef09cb) into main (d8e892a) will decrease coverage by 26.46%.
The diff coverage is 89.09%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #4908       +/-   ##
===========================================
- Coverage   89.50%   63.04%   -26.47%     
===========================================
  Files         225      226        +1     
  Lines       50238    44682     -5556     
===========================================
- Hits        44968    28168    -16800     
- Misses       5270    16514    +11244     
Impacted Files Coverage Δ
src/bgw/job_stat.c 8.63% <0.00%> (-83.46%) ⬇️
src/chunk.h 0.00% <ø> (-100.00%) ⬇️
src/cross_module_fn.c 1.67% <0.00%> (-66.28%) ⬇️
src/hypertable_restrict_info.c 36.05% <0.00%> (-55.09%) ⬇️
src/nodes/hypertable_modify.c 29.68% <0.00%> (-6.10%) ⬇️
src/ts_catalog/catalog.c 17.46% <0.00%> (-68.46%) ⬇️
src/ts_catalog/catalog.h 100.00% <ø> (ø)
src/ts_catalog/continuous_agg.h 100.00% <ø> (ø)
src/utils.h 16.66% <ø> (-63.34%) ⬇️
tsl/src/compression/compression.h 0.00% <ø> (ø)
... and 254 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dd45cf...2ef09cb. Read the comment docs.

@fabriziomello fabriziomello force-pushed the use_oidisvalid_macro_instead_of_invalidoid_comparison branch 2 times, most recently from f822815 to c24619e Compare November 3, 2022 14:54
@fabriziomello fabriziomello enabled auto-merge (rebase) November 3, 2022 14:55
@fabriziomello fabriziomello force-pushed the use_oidisvalid_macro_instead_of_invalidoid_comparison branch from c24619e to 81fc8ad Compare November 3, 2022 15:02
Postgres source code define the macro `OidIsValid()` to check if the Oid
is valid or not (comparing against the `InvalidOid` type). See
`src/include/c.h` in Postgres source three.

Changed all direct comparisons against `InvalidOid` for the `OidIsValid`
call and add a coccinelle check to make sure the future changes will use
it correctly.
@fabriziomello fabriziomello force-pushed the use_oidisvalid_macro_instead_of_invalidoid_comparison branch from 81fc8ad to 2ef09cb Compare November 3, 2022 17:30
@fabriziomello fabriziomello merged commit f153566 into timescale:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Team: Core Database tech-debt Needs refactoring and improvement tasks related to the source code and its architecture.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants